软件包 | 描述 |
---|---|
java.io |
通过数据流、序列化和文件系统提供系统的输入和输出。
|
java.lang |
提供对java编程语言的设计基础课。
|
java.nio.charset |
定义了字符集,解码器和编码器,字节和Unicode字符之间的转换。
|
java.nio.charset.spi |
为
java.nio.charset 包服务提供商类。
|
java.nio.file |
定义的接口和类的java虚拟机访问文件,文件属性,文件系统。
|
java.util.zip |
阅读和写作的标准压缩和gzip文件格式提供的类。
|
javax.tools |
为可以从程序调用的工具提供接口,例如,编译器。
|
Constructor and Description |
---|
InputStreamReader(InputStream in, Charset cs)
创建一个inputstreamreader使用给定的字符集。
|
OutputStreamWriter(OutputStream out, Charset cs)
创建一个outputstreamwriter使用给定的字符集。
|
Modifier and Type | Method and Description |
---|---|
byte[] |
String.getBytes(Charset charset)
这
String 编码为一个字节序列使用给定的
charset,结果存放到一个新的字节数组。
|
Constructor and Description |
---|
String(byte[] bytes, Charset charset)
通过使用指定的
charset解码指定的字节数组构造了一个新的
String 。
|
String(byte[] bytes, int offset, int length, Charset charset)
构建了一种新的
String 通过解码指定的字节数组使用指定的
charset。
|
Modifier and Type | Field and Description |
---|---|
static Charset |
StandardCharsets.ISO_8859_1
拉丁字母表
|
static Charset |
StandardCharsets.US_ASCII
七位ASCII,又名
|
static Charset |
StandardCharsets.UTF_16
十六位UCS转换格式,字节顺序通过一个可选的字节顺序标记鉴定
|
static Charset |
StandardCharsets.UTF_16BE
十六位UCS转换格式,大端字节序
|
static Charset |
StandardCharsets.UTF_16LE
十六位UCS转换格式,小端字节顺序
|
static Charset |
StandardCharsets.UTF_8
八位UCS转换格式
|
Modifier and Type | Method and Description |
---|---|
Charset |
CharsetEncoder.charset()
返回创建此编码器的字符集。
|
Charset |
CharsetDecoder.charset()
返回创建此解码器的字符集。
|
static Charset |
Charset.defaultCharset()
返回该java虚拟机的默认字符集。
|
Charset |
CharsetDecoder.detectedCharset()
检索字符集是由该解码器 检测(可选操作)。
|
static Charset |
Charset.forName(String charsetName)
返回指定的字符集的字符集对象。
|
Modifier and Type | Method and Description |
---|---|
static SortedMap<String,Charset> |
Charset.availableCharsets()
构造一个排序图从正则字符集名称字符对象。
|
Modifier and Type | Method and Description |
---|---|
int |
Charset.compareTo(Charset that)
比较该字符集到另一个。
|
abstract boolean |
Charset.contains(Charset cs)
告诉这是否包含给定的字符集的字符集。
|
Constructor and Description |
---|
CharsetDecoder(Charset cs, float averageCharsPerByte, float maxCharsPerByte)
初始化一个新的解码器。
|
CharsetEncoder(Charset cs, float averageBytesPerChar, float maxBytesPerChar)
初始化一个新的编码器。
|
CharsetEncoder(Charset cs, float averageBytesPerChar, float maxBytesPerChar, byte[] replacement)
初始化一个新的编码器。
|
Modifier and Type | Method and Description |
---|---|
abstract Charset |
CharsetProvider.charsetForName(String charsetName)
检索对于给定的字符集的字符集。
|
Modifier and Type | Method and Description |
---|---|
abstract Iterator<Charset> |
CharsetProvider.charsets()
创建一个迭代器遍历字符集支持的提供者。
|
Modifier and Type | Method and Description |
---|---|
static Stream<String> |
Files.lines(Path path, Charset cs)
阅读所有的线从一个文件作为一个
Stream 。
|
static BufferedReader |
Files.newBufferedReader(Path path, Charset cs)
打开一个文件进行读取,返回一个
BufferedReader 可以用来有效方式从文件中读取文本。
|
static BufferedWriter |
Files.newBufferedWriter(Path path, Charset cs, OpenOption... options)
打开或创建一个文件写入,返回一个
BufferedWriter ,可以有效的方式将文件写入文本。
|
static List<String> |
Files.readAllLines(Path path, Charset cs)
从文件中读取所有行。
|
static Path |
Files.write(Path path, Iterable<? extends CharSequence> lines, Charset cs, OpenOption... options)
写入文本到文件的行。
|
Constructor and Description |
---|
ZipFile(File file, Charset charset)
打开一个用于读取指定的文件对象的压缩文件。
|
ZipFile(File file, int mode, Charset charset)
打开从指定的
File 对象在指定的模式读一个新的
ZipFile 。
|
ZipFile(String name, Charset charset)
打开一个读取的压缩文件。
|
ZipInputStream(InputStream in, Charset charset)
创建一个新的压缩输入流。
|
ZipOutputStream(OutputStream out, Charset charset)
创建一个新的压缩输出流。
|
Modifier and Type | Method and Description |
---|---|
StandardJavaFileManager |
DocumentationTool.getStandardFileManager(DiagnosticListener<? super JavaFileObject> diagnosticListener, Locale locale, Charset charset)
获取此工具的标准文件管理器实现的一个新实例。
|
StandardJavaFileManager |
JavaCompiler.getStandardFileManager(DiagnosticListener<? super JavaFileObject> diagnosticListener, Locale locale, Charset charset)
获取此工具的标准文件管理器实现的一个新实例。
|
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.