ByteSourceJsonBootstrapper (Jackson-core 2.1.1 API)
Date: 2012-11-11

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.fasterxml.jackson.core.json
Class ByteSourceJsonBootstrapper

    java.lang.Object
      com.fasterxml.jackson.core.json.ByteSourceJsonBootstrapper

    public final class ByteSourceJsonBootstrapper

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 boolean` | `_bigEndian`
`protected int` | `_bytesPerChar`
`protected IOContext` | `_context`
`protected InputStream` | `_in`
`protected byte[]` | `_inputBuffer`
`protected int` | `_inputProcessed` Current number of input units (bytes or chars) that were processed in previous blocks, before contents of current input buffer.

Constructor Summary
`ByteSourceJsonBootstrapper(IOContext ctxt, byte[] inputBuffer, int inputStart, int inputLen)`
`ByteSourceJsonBootstrapper(IOContext ctxt, InputStream in)`

Method Summary
`JsonParser` | `constructParser(int parserFeatures, ObjectCodec codec, BytesToNameCanonicalizer rootByteSymbols, CharsToNameCanonicalizer rootCharSymbols, boolean canonicalize, boolean intern)`
`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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### _context

    protected final IOContext _context

### _in

    protected final InputStream _in

### _inputBuffer

    protected final byte[] _inputBuffer

### _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.

### _bigEndian

    protected boolean _bigEndian

### _bytesPerChar

    protected int _bytesPerChar

Constructor Detail

### ByteSourceJsonBootstrapper

    public ByteSourceJsonBootstrapper(IOContext ctxt,
                                      InputStream in)

### ByteSourceJsonBootstrapper

    public ByteSourceJsonBootstrapper(IOContext ctxt,
                                      byte[] inputBuffer,
                                      int inputStart,
                                      int inputLen)

Method Detail

### 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 parserFeatures,
                                      ObjectCodec codec,
                                      BytesToNameCanonicalizer rootByteSymbols,
                                      CharsToNameCanonicalizer rootCharSymbols,
                                      boolean canonicalize,
                                      boolean intern)
                               throws IOException,
                                      JsonParseException

  Throws:
    `IOException`
    `JsonParseException`

### hasJSONFormat

    public static MatchStrength hasJSONFormat(InputAccessor acc)
                                       throws IOException

  Current implementation is not as thorough as other functionality (`ByteSourceJsonBootstrapper`); supports UTF-8, for example. But it should work, for now, and can be improved as necessary.

  Throws:
    `IOException`

### ensureLoaded

    protected boolean ensureLoaded(int minimum)
                            throws IOException

  Throws:
    `IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2012 FasterXML. All Rights Reserved.