java.lang.Object
java.io.InputStream
org.glavo.chardet.UnicodeBOMInputStream
- 所有已实现的接口:
Closeable,AutoCloseable
The
UnicodeBOMInputStream class wraps any
InputStream and detects the presence of any Unicode BOM
(Byte Order Mark) at its beginning, as defined by
RFC 3629 - UTF-8, a
transformation format of ISO 10646
The Unicode FAQ defines 5 types of BOMs:
00 00 FE FF = UTF-32, big-endian
FF FE 00 00 = UTF-32, little-endian
FE FF = UTF-16, big-endian
FF FE = UTF-16, little-endian
EF BB BF = UTF-8
Use the getBOM() method to know whether a BOM has been detected
or not.
Use the skipBOM() method to remove the detected BOM from the
wrapped InputStream object.
-
嵌套类概要
嵌套类修饰符和类型类说明static final classType safe enumeration class that describes the different types of Unicode BOMs. -
构造器概要
构造器构造器说明UnicodeBOMInputStream(InputStream inputStream) Constructs a newUnicodeBOMInputStreamthat wraps the specifiedInputStream.UnicodeBOMInputStream(InputStream inputStream, boolean skipIfFound) Constructs a newUnicodeBOMInputStreamthat wraps the specifiedInputStream.UnicodeBOMInputStream(InputStream inputStream, boolean skipIfFound, boolean useMark) Constructs a newUnicodeBOMInputStreamthat wraps the specifiedInputStream. -
方法概要
修饰符和类型方法说明intvoidclose()getBOM()Returns theBOMthat was detected in the wrappedInputStreamobject.voidmark(int readlimit) booleanintread()intread(byte[] b) intread(byte[] b, int off, int len) voidreset()longskip(long n) final UnicodeBOMInputStreamskipBOM()Skips theBOMthat was found in the wrappedInputStreamobject.从类继承的方法 java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
构造器详细资料
-
UnicodeBOMInputStream
Constructs a newUnicodeBOMInputStreamthat wraps the specifiedInputStream. By default, skip BOM bytes.- 参数:
inputStream- anInputStream.- 抛出:
NullPointerException- wheninputStreamisnull.IOException- on reading from the specifiedInputStreamwhen trying to detect the Unicode BOM.
-
UnicodeBOMInputStream
Constructs a newUnicodeBOMInputStreamthat wraps the specifiedInputStream.- 参数:
inputStream- anInputStream.skipIfFound- to automatically skip BOM bytes if found- 抛出:
NullPointerException- wheninputStreamisnull.IOException- on reading from the specifiedInputStreamwhen trying to detect the Unicode BOM.
-
UnicodeBOMInputStream
public UnicodeBOMInputStream(InputStream inputStream, boolean skipIfFound, boolean useMark) throws IOException Constructs a newUnicodeBOMInputStreamthat wraps the specifiedInputStream.- 参数:
inputStream- anInputStream.skipIfFound- to automatically skip BOM bytes if founduseMark- to select whether to call the mark/reset of theinputStream- 抛出:
NullPointerException- wheninputStreamisnull.IOException- on reading from the specifiedInputStreamwhen trying to detect the Unicode BOM.
-
-
方法详细资料
-
getBOM
Returns theBOMthat was detected in the wrappedInputStreamobject.- 返回:
- a
BOMvalue.
-
skipBOM
Skips theBOMthat was found in the wrappedInputStreamobject.- 返回:
- this
UnicodeBOMInputStream. - 抛出:
IOException- when trying to skip the BOM from the wrappedInputStreamobject.
-
read
- 指定者:
read在类中InputStream- 抛出:
IOException
-
read
- 覆盖:
read在类中InputStream- 抛出:
IOException
-
read
- 覆盖:
read在类中InputStream- 抛出:
IOException
-
skip
- 覆盖:
skip在类中InputStream- 抛出:
IOException
-
available
- 覆盖:
available在类中InputStream- 抛出:
IOException
-
close
- 指定者:
close在接口中AutoCloseable- 指定者:
close在接口中Closeable- 覆盖:
close在类中InputStream- 抛出:
IOException
-
mark
public void mark(int readlimit) - 覆盖:
mark在类中InputStream
-
reset
- 覆盖:
reset在类中InputStream- 抛出:
IOException
-
markSupported
public boolean markSupported()- 覆盖:
markSupported在类中InputStream
-