- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- org.eclipse.parsson.UnicodeDetectingInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
class UnicodeDetectingInputStream extends java.io.FilterInputStreamA filter stream that detects the unicode encoding for the original stream
-
-
Field Summary
Fields Modifier and Type Field Description private static byteBBprivate static byteBFprivate byte[]bufprivate intbufLenprivate java.nio.charset.Charsetcharsetprivate intcurIndexprivate static byteEFprivate static byteFEprivate static byteFFprivate static byteNULprivate static java.nio.charset.Charsetutf32Beprivate static java.nio.charset.Charsetutf32Le
-
Constructor Summary
Constructors Constructor Description UnicodeDetectingInputStream(java.io.InputStream is)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.nio.charset.CharsetdetectEncoding()private voidfillBuf()(package private) java.nio.charset.CharsetgetCharset()private static java.nio.charset.CharsetgetUtf32be()private static java.nio.charset.CharsetgetUtf32le()intread()intread(byte[] b, int off, int len)-
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, reset, skip
-
-
-
-
Field Detail
-
FF
private static final byte FF
- See Also:
- Constant Field Values
-
FE
private static final byte FE
- See Also:
- Constant Field Values
-
EF
private static final byte EF
- See Also:
- Constant Field Values
-
BB
private static final byte BB
- See Also:
- Constant Field Values
-
BF
private static final byte BF
- See Also:
- Constant Field Values
-
NUL
private static final byte NUL
- See Also:
- Constant Field Values
-
utf32Le
private static java.nio.charset.Charset utf32Le
-
utf32Be
private static java.nio.charset.Charset utf32Be
-
buf
private final byte[] buf
-
bufLen
private int bufLen
-
curIndex
private int curIndex
-
charset
private final java.nio.charset.Charset charset
-
-
Method Detail
-
getCharset
java.nio.charset.Charset getCharset()
-
fillBuf
private void fillBuf()
-
detectEncoding
private java.nio.charset.Charset detectEncoding()
-
getUtf32be
private static java.nio.charset.Charset getUtf32be()
-
getUtf32le
private static java.nio.charset.Charset getUtf32le()
-
read
public int read() throws java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
-