JSON
Version 1.0

org.codehaus.jackson.io
Class ByteSourceBootstrapper

java.lang.Object
  extended by org.codehaus.jackson.io.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 mInputProcessed
          Current number of input units (bytes or chars) that were processed in previous blocks, before contents of current input buffer.
 
Method Summary
static Reader bootstrap(IOContext ctxt, byte[] inputBuffer, int inputStart, int inputLen)
           
static Reader bootstrap(IOContext ctxt, InputStream in)
           
protected  boolean ensureLoaded(int minimum)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mInputProcessed

protected int mInputProcessed
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.

Method Detail

bootstrap

public static Reader bootstrap(IOContext ctxt,
                               InputStream in)
                        throws IOException,
                               JsonParseException
Throws:
IOException
JsonParseException

bootstrap

public static Reader bootstrap(IOContext ctxt,
                               byte[] inputBuffer,
                               int inputStart,
                               int inputLen)
                        throws IOException,
                               JsonParseException
Throws:
IOException
JsonParseException

ensureLoaded

protected boolean ensureLoaded(int minimum)
                        throws IOException
Throws:
IOException

JSON
Version 1.0

Apache License, Version 2.0