public abstract class AbstractNioByteChannel extends AbstractNioChannel
AbstractNioChannel
Channel
的基类,以字节为单位进行操作。
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractNioByteChannel.NioByteUnsafe |
AbstractNioChannel.AbstractNioUnsafe, AbstractNioChannel.NioUnsafe
AbstractChannel.AbstractUnsafe
Channel.Unsafe
readInterestOp
Modifier | Constructor and Description |
---|---|
protected |
AbstractNioByteChannel(Channel parent, java.nio.channels.SelectableChannel ch)
创建一个新的实例
|
Modifier and Type | Method and Description |
---|---|
protected void |
clearOpWrite() |
protected abstract int |
doReadBytes(ByteBuf buf)
将字节读入给定的 ByteBuf 并返回金额。
|
protected void |
doWrite(ChannelOutboundBuffer in)
将给定缓冲区的内容刷新到远程对等体。
|
protected int |
doWrite0(ChannelOutboundBuffer in)
将对象写入操作系统。
|
protected abstract int |
doWriteBytes(ByteBuf buf)
写入字节从给定的 ByteBuf 到底层的Channel 。
|
protected abstract long |
doWriteFileRegion(FileRegion region)
写一个 FileRegion
|
protected java.lang.Object |
filterOutboundMessage(java.lang.Object msg)
在将新消息添加到此 AbstractChannel 的ChannelOutboundBuffer 时调用 ,以便Channel 实现将消息转换为另一个消息。
|
protected void |
incompleteWrite(boolean setOpWrite) |
protected boolean |
isInputShutdown0() |
ChannelMetadata |
metadata()
返回 ChannelMetadata 的的Channel 其描述的性质Channel 。
|
protected AbstractNioChannel.AbstractNioUnsafe |
newUnsafe()
创建一个新的82470523861836实例,该实例将用于 Channel 的生命周期
|
protected void |
setOpWrite() |
protected abstract ChannelFuture |
shutdownInput()
关闭通道的输入端。
|
clearReadPending, doBeginRead, doClose, doConnect, doDeregister, doFinishConnect, doRegister, eventLoop, isCompatible, isOpen, isReadPending, javaChannel, newDirectBuffer, newDirectBuffer, selectionKey, setReadPending, unsafe
alloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, doBind, doDisconnect, doShutdownOutput, equals, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, localAddress, localAddress0, newChannelPipeline, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, parent, pipeline, read, remoteAddress, remoteAddress0, toString, voidPromise, write, write, writeAndFlush, writeAndFlush
attr, hasAttr
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
attr, hasAttr
protected abstract ChannelFuture shutdownInput()
protected boolean isInputShutdown0()
protected AbstractNioChannel.AbstractNioUnsafe newUnsafe()
AbstractChannel
AbstractChannel.AbstractUnsafe
实例,该实例将用于Channel
的生命周期
newUnsafe
在课堂上
AbstractChannel
public ChannelMetadata metadata()
Channel
复制的描述
ChannelMetadata
的的Channel
其描述的性质Channel
。
protected final int doWrite0(ChannelOutboundBuffer in) throws java.lang.Exception
in
- 包含要写入对象的集合。
ChannelConfig.getWriteSpinCount()
开始的写入量值递减的值。
典型的用例如下:
ByteBuf
(或其他空的内容),这是适当的 ChannelUtils.WRITE_STATUS_SNDBUF_FULL
- 如果尝试向操作系统写入数据,但没有数据被接受 java.lang.Exception
- 写入期间发生I / O异常。
protected void doWrite(ChannelOutboundBuffer in) throws java.lang.Exception
AbstractChannel
doWrite
在课堂上
AbstractChannel
java.lang.Exception
protected final java.lang.Object filterOutboundMessage(java.lang.Object msg)
AbstractChannel
AbstractChannel
的ChannelOutboundBuffer
时调用 ,以便Channel
实现将消息转换为另一个消息。
(例如堆缓冲区 - >直接缓冲区)
filterOutboundMessage
在课堂上
AbstractChannel
protected final void incompleteWrite(boolean setOpWrite)
protected abstract long doWriteFileRegion(FileRegion region) throws java.lang.Exception
FileRegion
region
- 应写入字节的FileRegion
java.lang.Exception
protected abstract int doReadBytes(ByteBuf buf) throws java.lang.Exception
ByteBuf
并返回金额。
java.lang.Exception
protected abstract int doWriteBytes(ByteBuf buf) throws java.lang.Exception
ByteBuf
到底层的Channel
。
buf
- 应写入字节的ByteBuf
java.lang.Exception
protected final void setOpWrite()
protected final void clearOpWrite()
Copyright © 2008–2018 The Netty Project. All rights reserved.