软件包 | 描述 |
---|---|
java.nio.channels |
定义了渠道,它代表的是能够执行I/O操作的实体连接,如文件和套接字;定义选择器,多路复用,非阻塞I/O操作。
|
java.util |
包含集合框架、遗留的集合类、事件模型、日期和时间的设施、国际化和各种实用工具类(一个字符串标记,一个随机数发生器,和一位阵列)。
|
Modifier and Type | Interface and Description |
---|---|
interface |
ByteChannel
一个可以读写字节的通道。
|
interface |
ScatteringByteChannel
可以将字节读取到一个缓冲区序列的一个通道。
|
interface |
SeekableByteChannel
一个字节通道保持当前位置,允许位置被改变。
|
Modifier and Type | Class and Description |
---|---|
class |
DatagramChannel
对于面向数据报套接字可选择频道。
|
class |
FileChannel
用于读、写、映射和操作文件的通道。
|
static class |
Pipe.SourceChannel
一个通道代表一
Pipe 可读的结束。
|
class |
SocketChannel
面向流的连接套接字的可选通道。
|
Modifier and Type | Method and Description |
---|---|
static ReadableByteChannel |
Channels.newChannel(InputStream in)
构建一个从给定流读取字节的通道。
|
Modifier and Type | Method and Description |
---|---|
static InputStream |
Channels.newInputStream(ReadableByteChannel ch)
构建一个从给定的信道读取字节的流。
|
static Reader |
Channels.newReader(ReadableByteChannel ch, CharsetDecoder dec, int minBufferCap)
构建读者解码字节从给定的信道使用给定的解码器。
|
static Reader |
Channels.newReader(ReadableByteChannel ch, String csName)
构建读者解码字节从给定的信道根据指定的字符集。
|
abstract long |
FileChannel.transferFrom(ReadableByteChannel src, long position, long count)
将字节从给定的可读字节通道传输到这个通道的文件中。
|
Constructor and Description |
---|
Scanner(ReadableByteChannel source)
构建产生扫描从指定通道值的新
Scanner 。
|
Scanner(ReadableByteChannel source, String charsetName)
构建产生扫描从指定通道值的新
Scanner 。
|
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.