public abstract class OioByteStreamChannel extends AbstractOioByteChannel
AbstractChannel.AbstractUnsafe
Channel.Unsafe
SO_TIMEOUT
Modifier | Constructor and Description |
---|---|
protected |
OioByteStreamChannel(Channel parent)
创建一个新的实例
|
Modifier and Type | Method and Description |
---|---|
protected void |
activate(java.io.InputStream is, java.io.OutputStream os)
激活这个实例。
|
protected int |
available()
返回准备从底层套接字读取的字节数。
|
protected void |
doClose()
关闭 Channel
|
protected int |
doReadBytes(ByteBuf buf)
从底层套接字读取字节。
|
protected void |
doWriteBytes(ByteBuf buf)
将 ByteBuf 所保存的数据写入底层套接字。
|
protected void |
doWriteFileRegion(FileRegion region)
将由 FileRegion 持有的数据写入底层套接字。
|
boolean |
isActive()
如果 Channel 处于活动状态并已连接,则返回true 。
|
doRead, doWrite, filterOutboundMessage, isInputShutdown, metadata, shutdownInput
clearReadPending, doBeginRead, doConnect, isCompatible, isReadPending, newUnsafe, setReadPending
alloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, doBind, doDeregister, doDisconnect, doRegister, doShutdownOutput, equals, eventLoop, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, localAddress, localAddress0, newChannelPipeline, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, parent, pipeline, read, remoteAddress, remoteAddress0, toString, unsafe, voidPromise, write, write, writeAndFlush, writeAndFlush
attr, hasAttr
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
attr, hasAttr
protected final void activate(java.io.InputStream is, java.io.OutputStream os)
isActive()
将返回true
。
protected int available()
AbstractOioByteChannel
available
在课堂上
AbstractOioByteChannel
protected int doReadBytes(ByteBuf buf) throws java.lang.Exception
AbstractOioByteChannel
doReadBytes
在课堂上
AbstractOioByteChannel
buf
- 写入读取字节的ByteBuf
java.lang.Exception
- 发生错误时抛出
protected void doWriteBytes(ByteBuf buf) throws java.lang.Exception
AbstractOioByteChannel
ByteBuf
保存的数据写入底层套接字。
doWriteBytes
在课堂上
AbstractOioByteChannel
buf
- 持有要传输的数据的ByteBuf
java.lang.Exception
- 发生错误时抛出
protected void doWriteFileRegion(FileRegion region) throws java.lang.Exception
AbstractOioByteChannel
FileRegion
保存的数据写入底层套接字。
doWriteFileRegion
在课堂上
AbstractOioByteChannel
region
- 持有要传输的数据的FileRegion
java.lang.Exception
- 发生错误时抛出
protected void doClose() throws java.lang.Exception
AbstractChannel
Channel
doClose
在课堂上
AbstractChannel
java.lang.Exception
Copyright © 2008–2018 The Netty Project. All rights reserved.