public abstract class AbstractNioByteChannel extends AbstractNioChannel
AbstractNioChannel base class for Channels that operate on bytes.AbstractNioChannel.AbstractNioUnsafe, AbstractNioChannel.NioUnsafeAbstractChannel.AbstractUnsafeChannel.UnsafereadInterestOp| Modifier | Constructor and Description |
|---|---|
protected |
AbstractNioByteChannel(Channel parent,
Integer id,
SelectableChannel ch)
Create a new instance
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract int |
doReadBytes(io.netty.buffer.ByteBuf buf)
Read bytes into the given
ByteBuf and return the amount. |
protected int |
doWrite(MessageList<Object> msgs,
int index)
Flush the content of the given
ByteBuf to the remote peer. |
protected abstract int |
doWriteBytes(io.netty.buffer.ByteBuf buf,
boolean lastSpin)
Write bytes form the given
ByteBuf to the underlying Channel. |
protected abstract long |
doWriteFileRegion(FileRegion region,
boolean lastSpin)
Write a
FileRegion |
protected AbstractNioChannel.AbstractNioUnsafe |
newUnsafe()
Create a new
AbstractChannel.AbstractUnsafe instance which will be used for the life-time of the Channel |
protected void |
updateOpWrite(long expectedWrittenBytes,
long writtenBytes,
boolean lastSpin) |
doBeginRead, doConnect, doDeregister, doFinishConnect, doRegister, eventLoop, isCompatible, isFlushPending, isInputShutdown, isOpen, javaChannel, selectionKey, unsafealloc, bind, bind, calculateMessageSize, checkEOF, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, doBind, doClose, doDisconnect, doPreClose, equals, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, localAddress, localAddress0, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, parent, pipeline, read, remoteAddress, remoteAddress0, toString, voidPromise, write, write, write, writeprotected AbstractNioByteChannel(Channel parent, Integer id, SelectableChannel ch)
parent - the parent Channel by which this instance was created. May be nullid - the id of this instance or null if one should be generatedch - the underlying SelectableChannel on which it operatesprotected AbstractNioChannel.AbstractNioUnsafe newUnsafe()
AbstractChannelAbstractChannel.AbstractUnsafe instance which will be used for the life-time of the ChannelnewUnsafe in class AbstractChannelprotected int doWrite(MessageList<Object> msgs, int index) throws Exception
AbstractChannelByteBuf to the remote peer.
Sub-classes may override this as this implementation will just thrown an UnsupportedOperationExceptiondoWrite in class AbstractChannelExceptionprotected abstract long doWriteFileRegion(FileRegion region, boolean lastSpin) throws Exception
FileRegionregion - the FileRegion from which the bytes should be writtenlastSpin - true if this is the last write tryException - thrown if an error accourprotected abstract int doReadBytes(io.netty.buffer.ByteBuf buf)
throws Exception
ByteBuf and return the amount.Exceptionprotected abstract int doWriteBytes(io.netty.buffer.ByteBuf buf,
boolean lastSpin)
throws Exception
ByteBuf to the underlying Channel.buf - the ByteBuf from which the bytes should be writtenlastSpin - true if this is the last write tryException - thrown if an error accourprotected final void updateOpWrite(long expectedWrittenBytes,
long writtenBytes,
boolean lastSpin)
Copyright © 2008-2013 The Netty Project. All Rights Reserved.