软件包 | 描述 |
---|---|
java.nio.channels |
定义了渠道,它代表的是能够执行I/O操作的实体连接,如文件和套接字;定义选择器,多路复用,非阻塞I/O操作。
|
Modifier and Type | Interface and Description |
---|---|
interface |
ByteChannel
一个可以读写字节的通道。
|
interface |
GatheringByteChannel
一个可以从一个缓冲区的序列写字节的通道。
|
interface |
SeekableByteChannel
一个字节通道保持当前位置,允许位置被改变。
|
Modifier and Type | Class and Description |
---|---|
class |
DatagramChannel
对于面向数据报套接字可选择频道。
|
class |
FileChannel
用于读、写、映射和操作文件的通道。
|
static class |
Pipe.SinkChannel
一个通道代表一
Pipe 可写结尾。
|
class |
SocketChannel
面向流的连接套接字的可选通道。
|
Modifier and Type | Method and Description |
---|---|
static WritableByteChannel |
Channels.newChannel(OutputStream out)
构造一个将字节写入给定流的通道。
|
Modifier and Type | Method and Description |
---|---|
static OutputStream |
Channels.newOutputStream(WritableByteChannel ch)
构造一个将字节写入给定信道的流。
|
static Writer |
Channels.newWriter(WritableByteChannel ch, CharsetEncoder enc, int minBufferCap)
构建一个作者,使用给定的编码器对字符进行编码,并将所得的字节写入给定的信道中。
|
static Writer |
Channels.newWriter(WritableByteChannel ch, String csName)
结构,根据指定的字符集编码的字符的字节写入到给定的信道的作家。
|
abstract long |
FileChannel.transferTo(long position, long count, WritableByteChannel target)
将字节从这通道的文件给出的可写字节通道。
|
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.