public static class NioChannel.ClosedNioChannel extends NioChannel
NioChannel.ClosedNioChannel
bufHandler, emptyBuf, sc, sm, socketWrapper
Constructor and Description |
---|
ClosedNioChannel() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this channel.
|
void |
free()
Free the channel memory
|
boolean |
isOpen()
Tells whether or not this channel is open.
|
int |
read(ByteBuffer dst)
Reads a sequence of bytes from this channel into the given buffer.
|
long |
read(ByteBuffer[] dsts,
int offset,
int length) |
void |
reset(SocketChannel channel,
NioEndpoint.NioSocketWrapper socketWrapper)
Reset the channel
|
void |
setAppReadBufHandler(ApplicationBufferHandler handler) |
String |
toString() |
int |
write(ByteBuffer src)
Writes a sequence of bytes to this channel from the given buffer.
|
long |
write(ByteBuffer[] srcs,
int offset,
int length) |
checkInterruptStatus, close, flush, flushOutbound, getAppReadBufHandler, getBufHandler, getIOChannel, getOutboundRemaining, handshake, isClosing, isHandshakeComplete, read, write
public void close() throws IOException
NioChannel
close
in interface Closeable
close
in interface AutoCloseable
close
in interface Channel
close
in class NioChannel
IOException
- If an I/O error occurspublic boolean isOpen()
NioChannel
isOpen
in interface Channel
isOpen
in class NioChannel
true
if, and only if, this channel is openpublic void reset(SocketChannel channel, NioEndpoint.NioSocketWrapper socketWrapper) throws IOException
NioChannel
reset
in class NioChannel
channel
- the socket channelsocketWrapper
- the socket wrapperIOException
- If a problem was encountered resetting the channelpublic void free()
NioChannel
free
in class NioChannel
public void setAppReadBufHandler(ApplicationBufferHandler handler)
setAppReadBufHandler
in class NioChannel
public int read(ByteBuffer dst) throws IOException
NioChannel
read
in interface ReadableByteChannel
read
in class NioChannel
dst
- The buffer into which bytes are to be transferred-1
if
the channel has reached end-of-streamIOException
- If some other I/O error occurspublic long read(ByteBuffer[] dsts, int offset, int length) throws IOException
read
in interface ScatteringByteChannel
read
in class NioChannel
IOException
public int write(ByteBuffer src) throws IOException
NioChannel
write
in interface WritableByteChannel
write
in class NioChannel
src
- The buffer from which bytes are to be retrievedIOException
- If some other I/O error occurspublic long write(ByteBuffer[] srcs, int offset, int length) throws IOException
write
in interface GatheringByteChannel
write
in class NioChannel
IOException
public String toString()
toString
in class NioChannel
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.