Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.activemq.transport.tcp
Class TcpBufferedOutputStream

    java.lang.Object
      java.io.OutputStream
          java.io.FilterOutputStream
              org.codehaus.activemq.transport.tcp.TcpBufferedOutputStream

public class TcpBufferedOutputStream
extends java.io.FilterOutputStream

An optimized buffered outputstream for Tcp

Version:
  $Revision: 1.4 $

Field Summary

Fields inherited from class java.io.FilterOutputStream
`out`

Constructor Summary
`TcpBufferedOutputStream(java.io.OutputStream out)` Constructor
`TcpBufferedOutputStream(java.io.OutputStream out, int size)` Creates a new buffered output stream to write data to the specified underlying output stream with the specified buffer size.

Method Summary
`protected void` | `checkClosed()` Checks that the stream has not been closed
`void` | `close()` close this stream
`void` | `flush()` flush the data to the output stream This doesn't call flush on the underlying outputstream, because Tcp is particularly efficent at doing this itself ....
`void` | `write(byte[] b, int off, int len)` write a byte array to the stream
`void` | `write(int b)` write a byte on to the stream

Methods inherited from class java.io.FilterOutputStream
`write`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TcpBufferedOutputStream

    public TcpBufferedOutputStream(java.io.OutputStream out)

  Constructor

Parameters:
  `out` -

### TcpBufferedOutputStream

    public TcpBufferedOutputStream(java.io.OutputStream out,
                                   int size)

  Creates a new buffered output stream to write data to the specified underlying output stream with the specified buffer size.

Parameters:
  `out` - the underlying output stream.
  `size` - the buffer size.
Throws:
  `java.lang.IllegalArgumentException` - if size <= 0.

Method Detail

### write

    public void write(int b)
               throws java.io.IOException

  write a byte on to the stream

  Parameters:
    `b` - - byte to write
  Throws:
    `java.io.IOException`

### write

    public void write(byte[] b,
                      int off,
                      int len)
               throws java.io.IOException

  write a byte array to the stream

  Parameters:
    `b` - the byte buffer
    `off` - the offset into the buffer
    `len` - the length of data to write
  Throws:
    `java.io.IOException`

### flush

    public void flush()
               throws java.io.IOException

  flush the data to the output stream This doesn't call flush on the underlying outputstream, because Tcp is particularly efficent at doing this itself ....

  Throws:
    `java.io.IOException`

### close

    public void close()
               throws java.io.IOException

  close this stream

  Throws:
    `java.io.IOException`

### checkClosed

    protected void checkClosed()
                        throws java.io.IOException

  Checks that the stream has not been closed

  Throws:
    `java.io.IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 Protique, Ltd.. All Rights Reserved.