public class NIOOutputStream extends OutputStream implements TimeStampStream
| Constructor and Description |
|---|
NIOOutputStream(WritableByteChannel out)
Constructor
|
NIOOutputStream(WritableByteChannel 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 |
|---|---|
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/IP is particularly efficient at doing
this itself ....
|
long |
getWriteTimestamp() |
boolean |
isWriting() |
void |
setEngine(SSLEngine engine) |
void |
write(byte[] b,
int off,
int len)
write a byte array to the stream
|
protected void |
write(ByteBuffer data) |
void |
write(int b)
write a byte on to the stream
|
writepublic NIOOutputStream(WritableByteChannel out)
out - the channel to write data to.public NIOOutputStream(WritableByteChannel 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 OutputStreamb - byte to writeIOException - if an error occurs while writing the data.public void write(byte[] b, int off, int len) throws IOException
write in class OutputStreamb - the byte bufferoff - the offset into the bufferlen - the length of data to writeIOException - if an error occurs while writing the data.public void flush() throws IOException
flush in interface Flushableflush in class OutputStreamIOException - if an error occurs while writing the data.public void close() throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionprotected void checkClosed() throws IOException
IOExceptionprotected void write(ByteBuffer data) throws IOException
IOExceptionpublic boolean isWriting()
isWriting in interface TimeStampStreampublic long getWriteTimestamp()
getWriteTimestamp in interface TimeStampStreamCopyright © 2005–2015 FuseSource, Corp.. All rights reserved.