public abstract class AbstractNioByteChannel extends AbstractNioChannel
AbstractNioChannel Channel的基类,以字节为单位进行操作。
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractNioByteChannel.NioByteUnsafe |
AbstractNioChannel.AbstractNioUnsafe, AbstractNioChannel.NioUnsafeAbstractChannel.AbstractUnsafeChannel.UnsafereadInterestOp| 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, unsafealloc, 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, writeAndFlushattr, hasAttrclone, finalize, getClass, notify, notifyAll, wait, wait, waitattr, hasAttrprotected 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.