org.codehaus.jackson.impl
Class ByteSourceBootstrapper
java.lang.Object
org.codehaus.jackson.impl.ByteSourceBootstrapper
public final class ByteSourceBootstrapper
- extends Object
This class is used to determine the encoding of byte stream
that is to contain JSON content. Rules are fairly simple, and
defined in JSON specification (RFC-4627 or newer), except
for BOM handling, which is a property of underlying
streams.
Field Summary |
protected int |
_inputProcessed
Current number of input units (bytes or chars) that were processed in
previous blocks,
before contents of current input buffer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_inputProcessed
protected int _inputProcessed
- Current number of input units (bytes or chars) that were processed in
previous blocks,
before contents of current input buffer.
Note: includes possible BOMs, if those were part of the input.
ByteSourceBootstrapper
public ByteSourceBootstrapper(IOContext ctxt,
InputStream in)
ByteSourceBootstrapper
public ByteSourceBootstrapper(IOContext ctxt,
byte[] inputBuffer,
int inputStart,
int inputLen)
detectEncoding
public JsonEncoding detectEncoding()
throws IOException,
JsonParseException
- Method that should be called after constructing an instace.
It will figure out encoding that content uses, to allow
for instantiating a proper scanner object.
- Throws:
IOException
JsonParseException
constructReader
public Reader constructReader()
throws IOException
- Throws:
IOException
constructParser
public JsonParser constructParser(int features,
ObjectCodec codec,
BytesToNameCanonicalizer rootByteSymbols,
CharsToNameCanonicalizer rootCharSymbols)
throws IOException,
JsonParseException
- Throws:
IOException
JsonParseException
ensureLoaded
protected boolean ensureLoaded(int minimum)
throws IOException
- Throws:
IOException