Class UnicodeDetectingInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.glassfish.json.UnicodeDetectingInputStream
- All Implemented Interfaces:
Closeable, AutoCloseable
A filter stream that detects the unicode encoding for the original
stream
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final byteprivate static final byteprivate final byte[]private intprivate final Charsetprivate intprivate static final byteprivate static final byteprivate static final byteprivate static final byteprivate static final Charsetprivate static final CharsetFields inherited from class FilterInputStream
in -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class FilterInputStream
available, close, mark, markSupported, read, reset, skipMethods inherited from class InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Field Details
-
UTF_32LE
-
UTF_32BE
-
FF
private static final byte FF- See Also:
-
FE
private static final byte FE- See Also:
-
EF
private static final byte EF- See Also:
-
BB
private static final byte BB- See Also:
-
BF
private static final byte BF- See Also:
-
NUL
private static final byte NUL- See Also:
-
buf
private final byte[] buf -
bufLen
private int bufLen -
curIndex
private int curIndex -
charset
-
-
Constructor Details
-
UnicodeDetectingInputStream
UnicodeDetectingInputStream(InputStream is)
-
-
Method Details
-
getCharset
Charset getCharset() -
fillBuf
private void fillBuf() -
detectEncoding
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-