public final class NioBufferWriter extends AbstractBufferWriter<ChannelByteBuffer>
| 构造器和说明 |
|---|
NioBufferWriter(ChunkPool chunkPool,
int bufferWriterQueueSize,
int chunkPoolBlockTime)
构造函数
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
void |
flush() |
boolean |
isClosed()
是否已经关闭
|
ChannelByteBuffer |
poll()
弹出队列中的数据
|
void |
write(SocketChannel socketChannel,
byte[] b,
int off,
int len) |
void |
writeAndFlush(SocketChannel socketChannel,
byte[] b) |
write, write, writeAndFlushwritepublic NioBufferWriter(ChunkPool chunkPool, int bufferWriterQueueSize, int chunkPoolBlockTime)
chunkPool - 内存池bufferWriterQueueSize - 写出队列大小chunkPoolBlockTime - 内存池最大阻塞时间public void write(SocketChannel socketChannel, byte[] b, int off, int len) throws IOException
IOExceptionpublic void writeAndFlush(SocketChannel socketChannel, byte[] b) throws IOException
socketChannel - b - 待输出数据IOException - 抛出异常public void flush()
flush 在接口中 Flushableflush 在类中 AbstractBufferWriter<ChannelByteBuffer>public void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 AbstractBufferWriter<ChannelByteBuffer>IOExceptionpublic boolean isClosed()
AbstractBufferWriterisClosed 在类中 AbstractBufferWriter<ChannelByteBuffer>public ChannelByteBuffer poll()
AbstractBufferWriterpoll 在类中 AbstractBufferWriter<ChannelByteBuffer>Copyright © 2021. All rights reserved.