java.io.Closeable
, java.lang.AutoCloseable
, java.nio.channels.AsynchronousByteChannel
, java.nio.channels.AsynchronousChannel
, java.nio.channels.Channel
public static class Nio2Channel.ClosedNio2Channel extends Nio2Channel
Nio2Channel.ClosedNio2Channel
bufHandler, emptyBuf, sc, socket
Constructor | Description |
---|---|
ClosedNio2Channel() |
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.
|
java.util.concurrent.Future<java.lang.Integer> |
read(java.nio.ByteBuffer dst) |
|
<A> void |
read(java.nio.ByteBuffer[] dsts,
int offset,
int length,
long timeout,
java.util.concurrent.TimeUnit unit,
A attachment,
java.nio.channels.CompletionHandler<java.lang.Long,? super A> handler) |
|
<A> void |
read(java.nio.ByteBuffer dst,
long timeout,
java.util.concurrent.TimeUnit unit,
A attachment,
java.nio.channels.CompletionHandler<java.lang.Integer,? super A> handler) |
|
void |
reset(java.nio.channels.AsynchronousSocketChannel channel,
SocketWrapperBase<Nio2Channel> socket) |
Reset the channel.
|
void |
setAppReadBufHandler(ApplicationBufferHandler handler) |
|
java.lang.String |
toString() |
|
java.util.concurrent.Future<java.lang.Integer> |
write(java.nio.ByteBuffer src) |
|
<A> void |
write(java.nio.ByteBuffer[] srcs,
int offset,
int length,
long timeout,
java.util.concurrent.TimeUnit unit,
A attachment,
java.nio.channels.CompletionHandler<java.lang.Long,? super A> handler) |
|
<A> void |
write(java.nio.ByteBuffer src,
long timeout,
java.util.concurrent.TimeUnit unit,
A attachment,
java.nio.channels.CompletionHandler<java.lang.Integer,? super A> handler) |
close, flush, getAppReadBufHandler, getBufHandler, getIOChannel, getSocket, handshake, isClosing, isHandshakeComplete, read, write
public void close() throws java.io.IOException
Nio2Channel
close
in interface java.nio.channels.AsynchronousChannel
close
in interface java.lang.AutoCloseable
close
in interface java.nio.channels.Channel
close
in interface java.io.Closeable
close
in class Nio2Channel
java.io.IOException
- If an I/O error occurspublic boolean isOpen()
Nio2Channel
isOpen
in interface java.nio.channels.Channel
isOpen
in class Nio2Channel
public void reset(java.nio.channels.AsynchronousSocketChannel channel, SocketWrapperBase<Nio2Channel> socket) throws java.io.IOException
Nio2Channel
reset
in class Nio2Channel
channel
- The new async channel to associate with this NIO2 channelsocket
- The new socket to associate with this NIO2 channeljava.io.IOException
- If a problem was encountered resetting the channelpublic void free()
Nio2Channel
free
in class Nio2Channel
public void setAppReadBufHandler(ApplicationBufferHandler handler)
setAppReadBufHandler
in class Nio2Channel
public java.util.concurrent.Future<java.lang.Integer> read(java.nio.ByteBuffer dst)
read
in interface java.nio.channels.AsynchronousByteChannel
read
in class Nio2Channel
public <A> void read(java.nio.ByteBuffer dst, long timeout, java.util.concurrent.TimeUnit unit, A attachment, java.nio.channels.CompletionHandler<java.lang.Integer,? super A> handler)
read
in class Nio2Channel
public <A> void read(java.nio.ByteBuffer[] dsts, int offset, int length, long timeout, java.util.concurrent.TimeUnit unit, A attachment, java.nio.channels.CompletionHandler<java.lang.Long,? super A> handler)
read
in class Nio2Channel
public java.util.concurrent.Future<java.lang.Integer> write(java.nio.ByteBuffer src)
write
in interface java.nio.channels.AsynchronousByteChannel
write
in class Nio2Channel
public <A> void write(java.nio.ByteBuffer src, long timeout, java.util.concurrent.TimeUnit unit, A attachment, java.nio.channels.CompletionHandler<java.lang.Integer,? super A> handler)
write
in class Nio2Channel
public <A> void write(java.nio.ByteBuffer[] srcs, int offset, int length, long timeout, java.util.concurrent.TimeUnit unit, A attachment, java.nio.channels.CompletionHandler<java.lang.Long,? super A> handler)
write
in class Nio2Channel
public java.lang.String toString()
toString
in class Nio2Channel
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.