Top Description Fields Constructors Methods
io.netty.channel.oio

public abstract Class AbstractOioByteChannel

extends AbstractOioChannel
Class Inheritance
Known Direct Subclasses
io.netty.channel.oio.OioByteStreamChannel
Imports
io.netty.buffer.ByteBuf, .ByteBufAllocator, io.netty.channel.Channel, .ChannelConfig, .ChannelFuture, .ChannelMetadata, .ChannelOption, .ChannelOutboundBuffer, .ChannelPipeline, .FileRegion, .RecvByteBufAllocator, io.netty.channel.socket.ChannelInputShutdownEvent, .ChannelInputShutdownReadComplete, io.netty.util.internal.StringUtil, java.io.IOException

Deprecated

use NIO / EPOLL / KQUEUE transport.

Abstract base class for OIO which reads and writes bytes from/to a Socket

Field Summary

Modifier and TypeField and Description
private static final String
private static final ChannelMetadata
Inherited from io.netty.channel.oio.AbstractOioChannel:
readPendingreadTaskreadWhenInactiveSO_TIMEOUT

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected abstract int
available()

Return the number of bytes ready to read from the underlying Socket.

private void
protected void
protected abstract int

Returns:

amount the number of bytes read. This may return a negative amount if the underlying Socket was closed
doReadBytes
(ByteBuf
the ByteBuf into which the read bytes will be written
buf
)

Read bytes from the underlying Socket.

protected void
doWrite(ChannelOutboundBuffer in)

Implements abstract io.netty.channel.AbstractChannel.doWrite.

Flush the content of the given buffer to the remote peer.
protected abstract void
doWriteBytes(ByteBuf
the ByteBuf which holds the data to transfer
buf
)

Write the data which is hold by the ByteBuf to the underlying Socket.

protected abstract void
doWriteFileRegion(FileRegion
the FileRegion which holds the data to transfer
region
)

Write the data which is hold by the FileRegion to the underlying Socket.

protected final Object
filterOutboundMessage(Object msg)

Overrides io.netty.channel.AbstractChannel.filterOutboundMessage.

Invoked when a new message is added to a ChannelOutboundBuffer of this AbstractChannel, so that the Channel implementation converts the message to another.
private void
handleReadException(ChannelPipeline pipeline, ByteBuf byteBuf, Throwable cause, boolean close, RecvByteBufAllocator.Handle allocHandle)

Deprecated as a consequence of RecvByteBufAllocator.Handle being deprecated.
protected abstract boolean

Returns:

true if the input side of this channel is shutdown.
isInputShutdown
()

Determine if the input side of this channel is shutdown.

public ChannelMetadata
metadata()

Implements io.netty.channel.Channel.metadata.

Return the ChannelMetadata of the Channel which describe the nature of the Channel.
protected abstract ChannelFuture

Returns:

A channel future that will complete when the shutdown is complete.
shutdownInput
()

Shutdown the input side of this channel.

Inherited from io.netty.channel.oio.AbstractOioChannel:
clearReadPendingdoBeginReaddoConnectisCompatibleisReadPendingnewUnsafesetReadPending

Field Detail

EXPECTED_TYPESback to summary
private static final String EXPECTED_TYPES
METADATAback to summary
private static final ChannelMetadata METADATA

Constructor Detail

AbstractOioByteChannelback to summary
protected AbstractOioByteChannel(Channel parent)
See Also
AbstractOioByteChannel#AbstractOioByteChannel(Channel)

Method Detail

availableback to summary
protected abstract int available()

Return the number of bytes ready to read from the underlying Socket.

closeOnReadback to summary
private void closeOnRead(ChannelPipeline pipeline)
doReadback to summary
protected void doRead()

Implements abstract io.netty.channel.oio.AbstractOioChannel.doRead.

Annotations
@Override
doReadBytesback to summary
protected abstract int doReadBytes(ByteBuf buf) throws Exception

Read bytes from the underlying Socket.

Parameters
buf:ByteBuf

the ByteBuf into which the read bytes will be written

Returns:int

amount the number of bytes read. This may return a negative amount if the underlying Socket was closed

Exceptions
Exception:
is thrown if an error occurred
doWriteback to summary
protected void doWrite(ChannelOutboundBuffer in) throws Exception

Implements abstract io.netty.channel.AbstractChannel.doWrite.

Doc from io.netty.channel.AbstractChannel.doWrite.

Flush the content of the given buffer to the remote peer.

Annotations
@Override
doWriteBytesback to summary
protected abstract void doWriteBytes(ByteBuf buf) throws Exception

Write the data which is hold by the ByteBuf to the underlying Socket.

Parameters
buf:ByteBuf

the ByteBuf which holds the data to transfer

Exceptions
Exception:
is thrown if an error occurred
doWriteFileRegionback to summary
protected abstract void doWriteFileRegion(FileRegion region) throws Exception

Write the data which is hold by the FileRegion to the underlying Socket.

Parameters
region:FileRegion

the FileRegion which holds the data to transfer

Exceptions
Exception:
is thrown if an error occurred
filterOutboundMessageback to summary
protected final Object filterOutboundMessage(Object msg) throws Exception

Overrides io.netty.channel.AbstractChannel.filterOutboundMessage.

Doc from io.netty.channel.AbstractChannel.filterOutboundMessage.

Invoked when a new message is added to a ChannelOutboundBuffer of this AbstractChannel, so that the Channel implementation converts the message to another. (e.g. heap buffer -> direct buffer)

Annotations
@Override
handleReadExceptionback to summary
private void handleReadException(ChannelPipeline pipeline, ByteBuf byteBuf, Throwable cause, boolean close, RecvByteBufAllocator.Handle allocHandle)

Deprecated

as a consequence of RecvByteBufAllocator.Handle being deprecated. See corresponding docs for further information.

isInputShutdownback to summary
protected abstract boolean isInputShutdown()

Determine if the input side of this channel is shutdown.

Returns:boolean

true if the input side of this channel is shutdown.

metadataback to summary
public ChannelMetadata metadata()

Implements io.netty.channel.Channel.metadata.

Doc from io.netty.channel.Channel.metadata.

Return the ChannelMetadata of the Channel which describe the nature of the Channel.

Annotations
@Override
shutdownInputback to summary
protected abstract ChannelFuture shutdownInput()

Shutdown the input side of this channel.

Returns:ChannelFuture

A channel future that will complete when the shutdown is complete.