public final class ByteSourceJsonBootstrapper extends Object
Modifier and Type | Field and Description |
---|---|
static byte |
UTF8_BOM_1 |
static byte |
UTF8_BOM_2 |
static byte |
UTF8_BOM_3 |
Constructor and Description |
---|
ByteSourceJsonBootstrapper(IOContext ctxt,
byte[] inputBuffer,
int inputStart,
int inputLen) |
ByteSourceJsonBootstrapper(IOContext ctxt,
InputStream in) |
Modifier and Type | Method and Description |
---|---|
JsonParser |
constructParser(int parserFeatures,
ObjectCodec codec,
ByteQuadsCanonicalizer rootByteSymbols,
CharsToNameCanonicalizer rootCharSymbols,
int factoryFeatures) |
Reader |
constructReader() |
JsonEncoding |
detectEncoding()
Method that should be called after constructing an instace.
|
protected boolean |
ensureLoaded(int minimum) |
static MatchStrength |
hasJSONFormat(InputAccessor acc)
Current implementation is not as thorough as other functionality
(
ByteSourceJsonBootstrapper );
supports UTF-8, for example. |
static int |
skipUTF8BOM(DataInput input)
Helper method that may be called to see if given
DataInput
has BOM marker, and if so, to skip it. |
public static final byte UTF8_BOM_1
public static final byte UTF8_BOM_2
public static final byte UTF8_BOM_3
public ByteSourceJsonBootstrapper(IOContext ctxt, InputStream in)
public ByteSourceJsonBootstrapper(IOContext ctxt, byte[] inputBuffer, int inputStart, int inputLen)
public JsonEncoding detectEncoding() throws IOException
JsonEncoding
detected, if any; JsonEncoding.UTF8
otherwiseIOException
- If read from underlying input source failspublic static int skipUTF8BOM(DataInput input) throws IOException
DataInput
has BOM marker, and if so, to skip it.input
- DataInput to read content fromint
) read after possible UTF-8 BOMIOException
- If read from underlying input source failspublic Reader constructReader() throws IOException
IOException
public JsonParser constructParser(int parserFeatures, ObjectCodec codec, ByteQuadsCanonicalizer rootByteSymbols, CharsToNameCanonicalizer rootCharSymbols, int factoryFeatures) throws IOException
IOException
public static MatchStrength hasJSONFormat(InputAccessor acc) throws IOException
ByteSourceJsonBootstrapper
);
supports UTF-8, for example. But it should work, for now, and can
be improved as necessary.acc
- InputAccessor to use for accessing content to checknull
)IOException
- if input access fails due to read problemprotected boolean ensureLoaded(int minimum) throws IOException
IOException
Copyright © 2008–2023 FasterXML. All rights reserved.