- 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.FilterInputStream
A filter stream that detects the unicode encoding for the original stream
-
-
Field Summary
Fields Modifier and Type Field Description private static byte
BB
private static byte
BF
private byte[]
buf
private int
bufLen
private java.nio.charset.Charset
charset
private int
curIndex
private static byte
EF
private static byte
FE
private static byte
FF
private static byte
NUL
private static java.nio.charset.Charset
utf32Be
private static java.nio.charset.Charset
utf32Le
-
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.Charset
detectEncoding()
private void
fillBuf()
(package private) java.nio.charset.Charset
getCharset()
private static java.nio.charset.Charset
getUtf32be()
private static java.nio.charset.Charset
getUtf32le()
int
read()
int
read(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:
read
in classjava.io.FilterInputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException
- Overrides:
read
in classjava.io.FilterInputStream
- Throws:
java.io.IOException
-
-