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

public abstract Class OioByteStreamChannel

extends AbstractOioByteChannel
Class Inheritance
Known Direct Subclasses
io.netty.channel.socket.oio.OioSocketChannel
Annotations
@Deprecated
Imports
io.netty.buffer.ByteBuf, io.netty.channel.Channel, .FileRegion, .RecvByteBufAllocator, io.netty.util.internal.ObjectUtil, java.io.EOFException, .IOException, .InputStream, .OutputStream, java.nio.channels.Channels, .ClosedChannelException, .NotYetConnectedException, .WritableByteChannel

Deprecated

use NIO / EPOLL / KQUEUE transport.

Abstract base class for OIO Channels that are based on streams.

Field Summary

Modifier and TypeField and Description
private static final InputStream
private static final OutputStream
private InputStream
private OutputStream
private WritableByteChannel

Constructor Summary

AccessConstructor and Description
protected
OioByteStreamChannel(Channel
the parent Channel which was used to create this instance. This can be null if the has no parent as it was created by your self.
parent
)

Create a new instance

Method Summary

Modifier and TypeMethod and Description
protected final void
activate(InputStream is, OutputStream os)

Activate this instance.

protected int
available()

Implements abstract io.netty.channel.oio.AbstractOioByteChannel.available.

Return the number of bytes ready to read from the underlying Socket.
private static void
protected void
protected int
doReadBytes(ByteBuf
the ByteBuf into which the read bytes will be written
buf
)

Implements abstract io.netty.channel.oio.AbstractOioByteChannel.doReadBytes.

Read bytes from the underlying Socket.
protected void
doWriteBytes(ByteBuf
the ByteBuf which holds the data to transfer
buf
)

Implements abstract io.netty.channel.oio.AbstractOioByteChannel.doWriteBytes.

Write the data which is hold by the ByteBuf to the underlying Socket.
protected void
doWriteFileRegion(FileRegion
the FileRegion which holds the data to transfer
region
)

Implements abstract io.netty.channel.oio.AbstractOioByteChannel.doWriteFileRegion.

Write the data which is hold by the FileRegion to the underlying Socket.
public boolean
isActive()

Implements io.netty.channel.Channel.isActive.

Return true if the Channel is active and so connected.
Inherited from io.netty.channel.oio.AbstractOioByteChannel:
doReaddoWritefilterOutboundMessageisInputShutdownmetadatashutdownInput

Field Detail

CLOSED_INback to summary
private static final InputStream CLOSED_IN
CLOSED_OUTback to summary
private static final OutputStream CLOSED_OUT
isback to summary
private InputStream is
osback to summary
private OutputStream os
outChannelback to summary
private WritableByteChannel outChannel

Constructor Detail

OioByteStreamChannelback to summary
protected OioByteStreamChannel(Channel parent)

Create a new instance

Parameters
parent:Channel

the parent Channel which was used to create this instance. This can be null if the has no parent as it was created by your self.

Method Detail

activateback to summary
protected final void activate(InputStream is, OutputStream os)

Activate this instance. After this call isActive() will return true.

availableback to summary
protected int available()

Implements abstract io.netty.channel.oio.AbstractOioByteChannel.available.

Doc from io.netty.channel.oio.AbstractOioByteChannel.available.

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

Annotations
@Override
checkEOFback to summary
private static void checkEOF(FileRegion region) throws IOException
doCloseback to summary
protected void doClose() throws Exception

Implements abstract io.netty.channel.AbstractChannel.doClose.

Doc from io.netty.channel.AbstractChannel.doClose.

Close the Channel

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

Implements abstract io.netty.channel.oio.AbstractOioByteChannel.doReadBytes.

Doc from io.netty.channel.oio.AbstractOioByteChannel.doReadBytes.

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

Annotations
@Override
Exceptions
Exception:
is thrown if an error occurred
doWriteBytesback to summary
protected void doWriteBytes(ByteBuf buf) throws Exception

Implements abstract io.netty.channel.oio.AbstractOioByteChannel.doWriteBytes.

Doc from io.netty.channel.oio.AbstractOioByteChannel.doWriteBytes.

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

Parameters
buf:ByteBuf

the ByteBuf which holds the data to transfer

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

Implements abstract io.netty.channel.oio.AbstractOioByteChannel.doWriteFileRegion.

Doc from io.netty.channel.oio.AbstractOioByteChannel.doWriteFileRegion.

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

Parameters
region:FileRegion

the FileRegion which holds the data to transfer

Annotations
@Override
Exceptions
Exception:
is thrown if an error occurred
isActiveback to summary
public boolean isActive()

Implements io.netty.channel.Channel.isActive.

Doc from io.netty.channel.Channel.isActive.

Return true if the Channel is active and so connected.

Annotations
@Override