public class ServiceChannel
extends java.lang.Object
implements java.nio.channels.AsynchronousByteChannel
AsynchronousByteChannel
based on an ExecutorService
.Constructor and Description |
---|
ServiceChannel(java.nio.channels.ReadableByteChannel in,
java.nio.channels.WritableByteChannel out,
java.util.concurrent.ExecutorService executor) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
isOpen() |
java.util.concurrent.Future<java.lang.Integer> |
read(java.nio.ByteBuffer dst) |
<A> void |
read(java.nio.ByteBuffer dst,
A attachment,
java.nio.channels.CompletionHandler<java.lang.Integer,? super A> handler) |
java.util.concurrent.Future<java.lang.Integer> |
write(java.nio.ByteBuffer src) |
<A> void |
write(java.nio.ByteBuffer src,
A attachment,
java.nio.channels.CompletionHandler<java.lang.Integer,? super A> handler) |
public ServiceChannel(java.nio.channels.ReadableByteChannel in, java.nio.channels.WritableByteChannel out, java.util.concurrent.ExecutorService executor)
public java.util.concurrent.Future<java.lang.Integer> read(java.nio.ByteBuffer dst)
read
in interface java.nio.channels.AsynchronousByteChannel
public <A> void read(java.nio.ByteBuffer dst, A attachment, java.nio.channels.CompletionHandler<java.lang.Integer,? super A> handler)
read
in interface java.nio.channels.AsynchronousByteChannel
public java.util.concurrent.Future<java.lang.Integer> write(java.nio.ByteBuffer src)
write
in interface java.nio.channels.AsynchronousByteChannel
public <A> void write(java.nio.ByteBuffer src, A attachment, java.nio.channels.CompletionHandler<java.lang.Integer,? super A> handler)
write
in interface java.nio.channels.AsynchronousByteChannel
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface java.nio.channels.AsynchronousChannel
close
in interface java.nio.channels.Channel
java.io.IOException
public boolean isOpen()
isOpen
in interface java.nio.channels.Channel
Copyright © 2007–2020. All rights reserved.