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.WritableByteChannel
public static class NioChannel.ClosedNioChannel extends NioChannel
NioChannel.ClosedNioChannel
bufHandler, 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() |
Reset the channel
|
void |
setAppReadBufHandler(ApplicationBufferHandler handler) |
|
void |
setIOChannel(java.nio.channels.SocketChannel sc) |
|
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, write
public void close() throws java.io.IOException
NioChannel
close
in interface java.lang.AutoCloseable
close
in interface java.nio.channels.Channel
close
in interface java.io.Closeable
close
in class NioChannel
java.io.IOException
- If an I/O error occurspublic boolean isOpen()
NioChannel
isOpen
in interface java.nio.channels.Channel
isOpen
in class NioChannel
public void reset() throws java.io.IOException
NioChannel
reset
in class NioChannel
java.io.IOException
- If a problem was encountered resetting the channelpublic void free()
NioChannel
free
in class NioChannel
public void setIOChannel(java.nio.channels.SocketChannel sc)
setIOChannel
in class NioChannel
public void setAppReadBufHandler(ApplicationBufferHandler handler)
setAppReadBufHandler
in class NioChannel
public int read(java.nio.ByteBuffer dst) throws java.io.IOException
NioChannel
read
in interface java.nio.channels.ReadableByteChannel
read
in class NioChannel
dst
- The buffer into which bytes are to be transferredjava.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.ScatteringByteChannel
read
in class NioChannel
java.io.IOException
public int write(java.nio.ByteBuffer src) throws java.io.IOException
NioChannel
write
in interface java.nio.channels.WritableByteChannel
write
in class NioChannel
src
- 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.GatheringByteChannel
write
in class NioChannel
java.io.IOException
public java.lang.String toString()
toString
in class NioChannel
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.