APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.utils

public Class UBJsonReader

extends Object
implements BaseJsonReader
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.utils.BaseJsonReader
Imports
java.io.DataInputStream, .IOException, .InputStream, com.badlogic.gdx.files.FileHandle

Lightweight UBJSON parser.

The default behavior is to parse the JSON into a DOM containing JsonValue objects. Extend this class and override methods to perform event driven parsing. When this is done, the parse methods will return null.
Author
Xoppa

Field Summary

Modifier and TypeField and Description
public boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public JsonValue
parse(InputStream input)

Implements com.badlogic.gdx.utils.BaseJsonReader.parse.

Parses the UBJSON from the given stream.

public JsonValue
public JsonValue
protected JsonValue
parse(final DataInputStream din, final byte type)

protected JsonValue
protected JsonValue
parseData(final DataInputStream din, final byte blockType)

protected JsonValue
protected long
parseSize(final DataInputStream din, final boolean useIntOnError, final long defaultValue)

protected long
parseSize(final DataInputStream din, final byte type, final boolean useIntOnError, final long defaultValue)

protected String
parseString(final DataInputStream din, final byte type)

protected String
parseString(final DataInputStream din, final boolean sOptional, final byte type)

protected String
readString(final DataInputStream din, final long size)

protected short
protected long
protected int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

oldFormatback to summary
public boolean oldFormat

Constructor Detail

UBJsonReaderback to summary
public UBJsonReader()

Method Detail

parseback to summary
public JsonValue parse(InputStream input)

Implements com.badlogic.gdx.utils.BaseJsonReader.parse.

Parses the UBJSON from the given stream.
For best performance you should provide buffered streams to this method!

Annotations
@Override
parseback to summary
public JsonValue parse(FileHandle file)

Implements com.badlogic.gdx.utils.BaseJsonReader.parse.

Annotations
@Override
parseback to summary
public JsonValue parse(final DataInputStream din) throws IOException
parseback to summary
protected JsonValue parse(final DataInputStream din, final byte type) throws IOException
parseArrayback to summary
protected JsonValue parseArray(final DataInputStream din) throws IOException
parseDataback to summary
protected JsonValue parseData(final DataInputStream din, final byte blockType) throws IOException
parseObjectback to summary
protected JsonValue parseObject(final DataInputStream din) throws IOException
parseSizeback to summary
protected long parseSize(final DataInputStream din, final boolean useIntOnError, final long defaultValue) throws IOException
parseSizeback to summary
protected long parseSize(final DataInputStream din, final byte type, final boolean useIntOnError, final long defaultValue) throws IOException
parseStringback to summary
protected String parseString(final DataInputStream din, final byte type) throws IOException
parseStringback to summary
protected String parseString(final DataInputStream din, final boolean sOptional, final byte type) throws IOException
readStringback to summary
protected String readString(final DataInputStream din, final long size) throws IOException
readUCharback to summary
protected short readUChar(final DataInputStream din) throws IOException
readUIntback to summary
protected long readUInt(final DataInputStream din) throws IOException
readUShortback to summary
protected int readUShort(final DataInputStream din) throws IOException