public class NIOOutputStream extends OutputStream
| 构造器和说明 |
|---|
NIOOutputStream(WritableByteChannel out) |
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.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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 ....
|
long |
getWriteTimestamp() |
boolean |
isWriting() |
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)
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 在类中 OutputStreamb - - byte to writeIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write 在类中 OutputStreamb - the byte bufferoff - the offset into the bufferlen - the length of data to writeIOExceptionpublic void flush()
throws IOException
flush 在接口中 Flushableflush 在类中 OutputStreamIOExceptionpublic void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 OutputStreamIOExceptionprotected void checkClosed()
throws IOException
IOExceptionprotected void write(ByteBuffer data) throws IOException
IOExceptionpublic boolean isWriting()
public long getWriteTimestamp()
Copyright © 2015. All rights reserved.