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. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionparse
(DataInputStream din) protected JsonValue
parse
(DataInputStream din, byte type) parse
(InputStream input) Parses the UBJSON from the given stream.protected JsonValue
protected JsonValue
parseData
(DataInputStream din, byte blockType) protected JsonValue
protected long
parseSize
(DataInputStream din, boolean useIntOnError, long defaultValue) protected long
parseSize
(DataInputStream din, byte type, boolean useIntOnError, long defaultValue) protected String
parseString
(DataInputStream din, boolean sOptional, byte type) protected String
parseString
(DataInputStream din, byte type) protected String
readString
(DataInputStream din, long size) protected short
readUChar
(DataInputStream din) protected long
readUInt
(DataInputStream din) protected int
-
Field Details
-
oldFormat
public boolean oldFormat
-
-
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:
parse
in interfaceBaseJsonReader
-
parse
- Specified by:
parse
in interfaceBaseJsonReader
-
parse
- 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
-