public final class ByteSourceJsonBootstrapper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
_bigEndian |
private boolean |
_bufferRecyclable
Flag that indicates whether buffer above is to be recycled
after being used or not.
|
protected int |
_bytesPerChar |
protected IOContext |
_context |
protected java.io.InputStream |
_in |
protected byte[] |
_inputBuffer |
private int |
_inputEnd |
protected int |
_inputProcessed
Current number of input units (bytes or chars) that were processed in
previous blocks,
before contents of current input buffer.
|
private int |
_inputPtr |
(package private) static byte |
UTF8_BOM_1 |
(package private) static byte |
UTF8_BOM_2 |
(package private) static byte |
UTF8_BOM_3 |
Constructor and Description |
---|
ByteSourceJsonBootstrapper(IOContext ctxt,
byte[] inputBuffer,
int inputStart,
int inputLen) |
ByteSourceJsonBootstrapper(IOContext ctxt,
java.io.InputStream in) |
Modifier and Type | Method and Description |
---|---|
private boolean |
checkUTF16(int i16) |
private boolean |
checkUTF32(int quad) |
JsonParser |
constructParser(int parserFeatures,
ObjectCodec codec,
ByteQuadsCanonicalizer rootByteSymbols,
CharsToNameCanonicalizer rootCharSymbols,
int factoryFeatures) |
java.io.Reader |
constructReader() |
JsonEncoding |
detectEncoding()
Method that should be called after constructing an instace.
|
protected boolean |
ensureLoaded(int minimum) |
private boolean |
handleBOM(int quad) |
static MatchStrength |
hasJSONFormat(InputAccessor acc)
Current implementation is not as thorough as other functionality
(
ByteSourceJsonBootstrapper );
supports UTF-8, for example. |
private void |
reportWeirdUCS4(java.lang.String type) |
private static int |
skipSpace(InputAccessor acc) |
private static int |
skipSpace(InputAccessor acc,
byte b) |
private static MatchStrength |
tryMatch(InputAccessor acc,
java.lang.String matchStr,
MatchStrength fullMatchStrength) |
static final byte UTF8_BOM_1
static final byte UTF8_BOM_2
static final byte UTF8_BOM_3
protected final IOContext _context
protected final java.io.InputStream _in
protected final byte[] _inputBuffer
private int _inputPtr
private int _inputEnd
private final boolean _bufferRecyclable
protected int _inputProcessed
Note: includes possible BOMs, if those were part of the input.
protected boolean _bigEndian
protected int _bytesPerChar
public ByteSourceJsonBootstrapper(IOContext ctxt, java.io.InputStream in)
public ByteSourceJsonBootstrapper(IOContext ctxt, byte[] inputBuffer, int inputStart, int inputLen)
public JsonEncoding detectEncoding() throws java.io.IOException
java.io.IOException
public java.io.Reader constructReader() throws java.io.IOException
java.io.IOException
public JsonParser constructParser(int parserFeatures, ObjectCodec codec, ByteQuadsCanonicalizer rootByteSymbols, CharsToNameCanonicalizer rootCharSymbols, int factoryFeatures) throws java.io.IOException
java.io.IOException
public static MatchStrength hasJSONFormat(InputAccessor acc) throws java.io.IOException
ByteSourceJsonBootstrapper
);
supports UTF-8, for example. But it should work, for now, and can
be improved as necessary.java.io.IOException
private static MatchStrength tryMatch(InputAccessor acc, java.lang.String matchStr, MatchStrength fullMatchStrength) throws java.io.IOException
java.io.IOException
private static int skipSpace(InputAccessor acc) throws java.io.IOException
java.io.IOException
private static int skipSpace(InputAccessor acc, byte b) throws java.io.IOException
java.io.IOException
private boolean handleBOM(int quad) throws java.io.IOException
java.io.IOException
private boolean checkUTF32(int quad) throws java.io.IOException
java.io.IOException
private boolean checkUTF16(int i16)
private void reportWeirdUCS4(java.lang.String type) throws java.io.IOException
java.io.IOException
protected boolean ensureLoaded(int minimum) throws java.io.IOException
java.io.IOException