Package arc.util.serialization
Class UBJsonReader
java.lang.Object
arc.util.serialization.UBJsonReader
- All Implemented Interfaces:
BaseJsonReader
Lightweight UBJSON parser.
The default behavior is to parse the JSON into a DOM containing
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. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionparse(DataInputStream din) protected JsonValueparse(DataInputStream din, byte type) parse(InputStream input) Parses the UBJSON from the given stream.protected JsonValueprotected JsonValueparseData(DataInputStream din, byte blockType) protected JsonValueprotected longparseSize(DataInputStream din, boolean useIntOnError, long defaultValue) protected longparseSize(DataInputStream din, byte type, boolean useIntOnError, long defaultValue) protected StringparseString(DataInputStream din, boolean sOptional, byte type) protected StringparseString(DataInputStream din, byte type) protected StringreadString(DataInputStream din, long size) protected shortreadUChar(DataInputStream din) protected longreadUInt(DataInputStream din) protected int
-
Constructor Details
-
UBJsonReader
public UBJsonReader()
-
-
Method Details
-
parse
Parses the UBJSON from the given stream.
For best performance you should provide buffered streams to this method!- Specified by:
parsein interfaceBaseJsonReader
-
parse
- Specified by:
parsein interfaceBaseJsonReader
-
parse
- Throws:
IOException
-
parseWihoutClosing
- Throws:
IOException
-
parse
- Throws:
IOException
-
parseArray
- Throws:
IOException
-
parseObject
- Throws:
IOException
-
parseData
- Throws:
IOException
-
parseString
- Throws:
IOException
-
parseString
- Throws:
IOException
-
parseSize
protected long parseSize(DataInputStream din, boolean useIntOnError, long defaultValue) throws IOException - Throws:
IOException
-
parseSize
protected long parseSize(DataInputStream din, byte type, boolean useIntOnError, long defaultValue) throws IOException - Throws:
IOException
-
readUChar
- Throws:
IOException
-
readUShort
- Throws:
IOException
-
readUInt
- Throws:
IOException
-
readString
- Throws:
IOException
-