インタフェース
java.nio.channels.CompletionHandlerの使用
| パッケージ | 説明 |
|---|---|
| java.nio.channels |
入出力操作を実行できるエンティティ(ファイル、ソケットなど)への接続を表すチャネルや、多重化された非ブロック入出力操作用のセレクタを定義します。
|
-
java.nio.channelsでのCompletionHandlerの使用
CompletionHandler型のパラメータを持つjava.nio.channelsのメソッド 修飾子と型 メソッド 説明 abstract <A> voidAsynchronousServerSocketChannel. accept(A attachment, CompletionHandler<AsynchronousSocketChannel,? super A> handler)接続を受け入れます。abstract <A> voidAsynchronousSocketChannel. connect(SocketAddress remote, A attachment, CompletionHandler<Void,? super A> handler)このチャネルを接続します。abstract <A> voidAsynchronousFileChannel. lock(long position, long size, boolean shared, A attachment, CompletionHandler<FileLock,? super A> handler)このチャネルのファイルの指定された領域をロックします。<A> voidAsynchronousFileChannel. lock(A attachment, CompletionHandler<FileLock,? super A> handler)このチャネルのファイル上に排他ロックを設定します。<A> voidAsynchronousByteChannel. read(ByteBuffer dst, A attachment, CompletionHandler<Integer,? super A> handler)このチャネルのバイト・シーケンスを指定のバッファに読み込みます。abstract <A> voidAsynchronousFileChannel. read(ByteBuffer dst, long position, A attachment, CompletionHandler<Integer,? super A> handler)このチャネルのバイト・シーケンスを、指定されたファイル位置からバッファに読み込みます。abstract <A> voidAsynchronousSocketChannel. read(ByteBuffer[] dsts, int offset, int length, long timeout, TimeUnit unit, A attachment, CompletionHandler<Long,? super A> handler)このチャネルのバイト・シーケンスを指定されたバッファのサブシーケンスに読み込みます。abstract <A> voidAsynchronousSocketChannel. read(ByteBuffer dst, long timeout, TimeUnit unit, A attachment, CompletionHandler<Integer,? super A> handler)このチャネルのバイト・シーケンスを指定のバッファに読み込みます。<A> voidAsynchronousSocketChannel. read(ByteBuffer dst, A attachment, CompletionHandler<Integer,? super A> handler)<A> voidAsynchronousByteChannel. write(ByteBuffer src, A attachment, CompletionHandler<Integer,? super A> handler)このチャネルのバイト・シーケンスを指定のバッファから書き出します。abstract <A> voidAsynchronousFileChannel. write(ByteBuffer src, long position, A attachment, CompletionHandler<Integer,? super A> handler)指定されたバッファのバイト・シーケンスをこのチャネルの指定されたファイル位置に書き込みます。abstract <A> voidAsynchronousSocketChannel. write(ByteBuffer[] srcs, int offset, int length, long timeout, TimeUnit unit, A attachment, CompletionHandler<Long,? super A> handler)このチャネルのバイト・シーケンスを指定されたバッファのサブシーケンスから書き出します。abstract <A> voidAsynchronousSocketChannel. write(ByteBuffer src, long timeout, TimeUnit unit, A attachment, CompletionHandler<Integer,? super A> handler)このチャネルのバイト・シーケンスを指定のバッファから書き出します。<A> voidAsynchronousSocketChannel. write(ByteBuffer src, A attachment, CompletionHandler<Integer,? super A> handler)