软件包 | 描述 |
---|---|
java.nio.channels |
定义了渠道,它代表的是能够执行I/O操作的实体连接,如文件和套接字;定义选择器,多路复用,非阻塞I/O操作。
|
Modifier and Type | Method and Description |
---|---|
abstract <A> void |
AsynchronousServerSocketChannel.accept(A attachment, CompletionHandler<AsynchronousSocketChannel,? super A> handler)
接受一个连接。
|
abstract <A> void |
AsynchronousSocketChannel.connect(SocketAddress remote, A attachment, CompletionHandler<Void,? super A> handler)
连接此通道。
|
<A> void |
AsynchronousFileChannel.lock(A attachment, CompletionHandler<FileLock,? super A> handler)
获取此通道文件上的互斥锁。
|
abstract <A> void |
AsynchronousFileChannel.lock(long position, long size, boolean shared, A attachment, CompletionHandler<FileLock,? super A> handler)
获取此通道文件的指定区域上的锁。
|
abstract <A> void |
AsynchronousSocketChannel.read(ByteBuffer[] dsts, int offset, int length, long timeout, TimeUnit unit, A attachment, CompletionHandler<Long,? super A> handler)
读这信入子序列给定的缓冲区字节序列。
|
<A> void |
AsynchronousSocketChannel.read(ByteBuffer dst, A attachment, CompletionHandler<Integer,? super A> handler) |
<A> void |
AsynchronousByteChannel.read(ByteBuffer dst, A attachment, CompletionHandler<Integer,? super A> handler)
从这个通道读取一个字节序列到给定的缓冲区中。
|
abstract <A> void |
AsynchronousFileChannel.read(ByteBuffer dst, long position, A attachment, CompletionHandler<Integer,? super A> handler)
从这个通道读取一个字节序列到给定的缓冲区,从给定的文件位置开始。
|
abstract <A> void |
AsynchronousSocketChannel.read(ByteBuffer dst, long timeout, TimeUnit unit, A attachment, CompletionHandler<Integer,? super A> handler)
从这个通道读取一个字节序列到给定的缓冲区中。
|
abstract <A> void |
AsynchronousSocketChannel.write(ByteBuffer[] srcs, int offset, int length, long timeout, TimeUnit unit, A attachment, CompletionHandler<Long,? super A> handler)
写一个字节序列的子序列对该通道从给定的缓冲区。
|
<A> void |
AsynchronousSocketChannel.write(ByteBuffer src, A attachment, CompletionHandler<Integer,? super A> handler) |
<A> void |
AsynchronousByteChannel.write(ByteBuffer src, A attachment, CompletionHandler<Integer,? super A> handler)
从给定的缓冲区中写入该通道的一个字节序列。
|
abstract <A> void |
AsynchronousFileChannel.write(ByteBuffer src, long position, A attachment, CompletionHandler<Integer,? super A> handler)
从给定的缓冲区中从给定的缓冲区中写入一个字节序列,从给定的文件位置开始。
|
abstract <A> void |
AsynchronousSocketChannel.write(ByteBuffer src, long timeout, TimeUnit unit, A attachment, CompletionHandler<Integer,? super A> handler)
从给定的缓冲区中写入该通道的一个字节序列。
|
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.