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 FilterOutputStream

An optimized buffered outputstream for Tcp

Version:
  $Revision: 1.4 $

Field Summary

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

Constructor Summary
`TcpBufferedOutputStream(OutputStream out)` Constructor
`TcpBufferedOutputStream(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(OutputStream out)

  Constructor

Parameters:
  `out` -

### TcpBufferedOutputStream

    public TcpBufferedOutputStream(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:
  `IllegalArgumentException` - if size <= 0.

Method Detail

### write

    public void write(int b)
               throws IOException

  write a byte on to the stream

  Parameters:
    `b` - - byte to write
  Throws:
    `IOException`

### write

    public void write(byte[] b,
                      int off,
                      int len)
               throws 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:
    `IOException`

### flush

    public void flush()
               throws 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:
    `IOException`

### close

    public void close()
               throws IOException

  close this stream

  Throws:
    `IOException`

### checkClosed

    protected void checkClosed()
                        throws IOException

  Checks that the stream has not been closed

  Throws:
    `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.