public class TcpBufferedOutputStream extends FilterOutputStream implements TimeStampStream
out
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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 ....
|
long |
getWriteTimestamp() |
boolean |
isWriting() |
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
|
write
public TcpBufferedOutputStream(OutputStream out)
out
- public TcpBufferedOutputStream(OutputStream out, int size)
out
- the underlying output stream.size
- the buffer size.IllegalArgumentException
- if size <= 0.public void write(int b) throws IOException
write
in class FilterOutputStream
b
- - byte to writeIOException
public void write(byte[] b, int off, int len) throws IOException
write
in class FilterOutputStream
b
- the byte bufferoff
- the offset into the bufferlen
- the length of data to writeIOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class FilterOutputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class FilterOutputStream
IOException
public boolean isWriting()
isWriting
in interface TimeStampStream
public long getWriteTimestamp()
getWriteTimestamp
in interface TimeStampStream
Copyright © 2005–2016 FuseSource, Corp.. All rights reserved.