程序包 tools
类 UnicodeReader
- java.lang.Object
-
- java.io.Reader
-
- tools.UnicodeReader
-
- 所有已实现的接口:
java.io.Closeable,java.lang.AutoCloseable,java.lang.Readable
public class UnicodeReader extends java.io.ReaderGeneric unicode textreader, which will use BOM mark to identify the encoding to be used. If BOM is not found then use a given default or system encoding.
-
-
构造器概要
构造器 构造器 说明 UnicodeReader(java.io.InputStream in, java.lang.String defaultEnc)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidclose()关闭java.lang.StringgetDefaultEncoding()java.lang.StringgetEncoding()Get stream encoding or NULL if stream is uninitialized.protected voidinit()Read-ahead four bytes and check for BOM marks.intread(char[] cbuf, int off, int len)读字符数组
-
-
-
方法详细资料
-
getDefaultEncoding
public java.lang.String getDefaultEncoding()
- 返回:
- 默认的字符集
-
getEncoding
public java.lang.String getEncoding()
Get stream encoding or NULL if stream is uninitialized. Call init() or read() method to initialize it.- 返回:
- text encoding
-
init
protected void init() throws java.io.IOExceptionRead-ahead four bytes and check for BOM marks. Extra bytes are unread back to the stream, only BOM bytes are skipped.- 抛出:
java.io.IOException- 异常
-
close
public void close() throws java.io.IOException关闭- 指定者:
close在接口中java.lang.AutoCloseable- 指定者:
close在接口中java.io.Closeable- 指定者:
close在类中java.io.Reader- 抛出:
java.io.IOException
-
read
public int read(char[] cbuf, int off, int len) throws java.io.IOException读字符数组- 指定者:
read在类中java.io.Reader- 参数:
cbuf- 缓冲数组off- 开始偏移位置len- 计划读取的长度- 返回:
- 实际读取的长度
- 抛出:
java.io.IOException
-
-