java.io.Closeable, java.lang.AutoCloseable, java.nio.channels.ByteChannel, java.nio.channels.Channel, java.nio.channels.GatheringByteChannel, java.nio.channels.ReadableByteChannel, java.nio.channels.ScatteringByteChannel, java.nio.channels.WritableByteChannelpublic static class NioChannel.ClosedNioChannel extends NioChannel
NioChannel.ClosedNioChannelbufHandler, emptyBuf, sc, sm, socketWrapper| Constructor | Description |
|---|---|
ClosedNioChannel() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Closes this channel.
|
void |
free() |
Free the channel memory
|
boolean |
isOpen() |
Tells whether or not this channel is open.
|
int |
read(java.nio.ByteBuffer dst) |
Reads a sequence of bytes from this channel into the given buffer.
|
long |
read(java.nio.ByteBuffer[] dsts,
int offset,
int length) |
|
void |
reset(java.nio.channels.SocketChannel channel,
NioEndpoint.NioSocketWrapper socketWrapper) |
Reset the channel
|
void |
setAppReadBufHandler(ApplicationBufferHandler handler) |
|
java.lang.String |
toString() |
|
int |
write(java.nio.ByteBuffer src) |
Writes a sequence of bytes to this channel from the given buffer.
|
long |
write(java.nio.ByteBuffer[] srcs,
int offset,
int length) |
checkInterruptStatus, close, flush, flushOutbound, getAppReadBufHandler, getBufHandler, getIOChannel, getOutboundRemaining, handshake, isClosing, isHandshakeComplete, read, writepublic void close()
throws java.io.IOException
NioChannelclose in interface java.lang.AutoCloseableclose in interface java.nio.channels.Channelclose in interface java.io.Closeableclose in class NioChanneljava.io.IOException - If an I/O error occurspublic boolean isOpen()
NioChannelisOpen in interface java.nio.channels.ChannelisOpen in class NioChanneltrue if, and only if, this channel is openpublic void reset(java.nio.channels.SocketChannel channel,
NioEndpoint.NioSocketWrapper socketWrapper)
throws java.io.IOException
NioChannelreset in class NioChannelchannel - the socket channelsocketWrapper - the socket wrapperjava.io.IOException - If a problem was encountered resetting the channelpublic void free()
NioChannelfree in class NioChannelpublic void setAppReadBufHandler(ApplicationBufferHandler handler)
setAppReadBufHandler in class NioChannelpublic int read(java.nio.ByteBuffer dst)
throws java.io.IOException
NioChannelread in interface java.nio.channels.ReadableByteChannelread in class NioChanneldst - The buffer into which bytes are to be transferred-1 if
the channel has reached end-of-streamjava.io.IOException - If some other I/O error occurspublic long read(java.nio.ByteBuffer[] dsts,
int offset,
int length)
throws java.io.IOException
read in interface java.nio.channels.ScatteringByteChannelread in class NioChanneljava.io.IOExceptionpublic int write(java.nio.ByteBuffer src)
throws java.io.IOException
NioChannelwrite in interface java.nio.channels.WritableByteChannelwrite in class NioChannelsrc - The buffer from which bytes are to be retrievedjava.io.IOException - If some other I/O error occurspublic long write(java.nio.ByteBuffer[] srcs,
int offset,
int length)
throws java.io.IOException
write in interface java.nio.channels.GatheringByteChannelwrite in class NioChanneljava.io.IOExceptionpublic java.lang.String toString()
toString in class NioChannelCopyright © 2000-2020 Apache Software Foundation. All Rights Reserved.