Package org.apache.camel.jsonpath
Class JsonStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.apache.camel.jsonpath.JsonStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
Special stream for JSON streams. Determines from the first 4 bytes the JSON encoding according to JSON specification
RFC-4627 or newer. In addition BOMs are taken into account.
This class is not thread safe.
-
Field Summary
Fields inherited from class java.io.FilterInputStream
in
-
Constructor Summary
-
Method Summary
Methods inherited from class java.io.FilterInputStream
available, close, mark
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
JsonStream
Constructor. Determines the encoding during the instantiation according to JSON specification RFC-4627 or newer. In addition BOMs are taken into account.- Parameters:
in
- input stream must contain a JSON content- Throws:
IOException
- if an error occurs during the determination of the encodingCharConversionException
- if the UCS4 endianess 2143 or 3412 is usedIllegalArgumentException
- if the input stream isnull
-
-
Method Details
-
getEncoding
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
skip
- Overrides:
skip
in classFilterInputStream
- Throws:
IOException
-
reset
- Overrides:
reset
in classFilterInputStream
- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupported
in classFilterInputStream
-