Package one.nio.serial
Class JsonReader
java.lang.Object
one.nio.serial.JsonReader
Beware: this is NOT a complete and fully compliant JSON parser!
Its main purpose is to decode typical simple queries without third-party dependencies.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal IOExceptionfinal voidfinal intnext()protected intread()byte[]final booleanfinal bytereadByte()final charreadChar()final doublefinal charfloatfinal intfinal intreadInt()final longreadLong()readMap()readNull()final String<T> TreadObject(Class<T> cls) readObject(Type type) final shortfinal int
-
Field Details
-
array
protected byte[] array -
offset
protected int offset -
next
protected int next
-
-
Constructor Details
-
JsonReader
public JsonReader(byte[] array) -
JsonReader
public JsonReader(byte[] array, int offset)
-
-
Method Details
-
read
protected int read() -
next
public final int next() -
skipWhitespace
public final int skipWhitespace() -
exception
-
expect
- Throws:
IOException
-
readBoolean
- Throws:
IOException
-
readByte
- Throws:
IOException
-
readShort
- Throws:
IOException
-
readChar
- Throws:
IOException
-
readInt
- Throws:
IOException
-
readLong
- Throws:
IOException
-
readFloat
- Throws:
IOException
-
readDouble
- Throws:
IOException
-
readNumber
- Throws:
IOException
-
readHexChar
- Throws:
IOException
-
readEscapeChar
- Throws:
IOException
-
readNull
- Throws:
IOException
-
readString
- Throws:
IOException
-
readBinary
- Throws:
IOException
-
readArray
- Throws:
IOExceptionClassNotFoundException
-
readArray
- Throws:
IOExceptionClassNotFoundException
-
readMap
- Throws:
IOExceptionClassNotFoundException
-
readMap
public <K> Map<K,Object> readMap(Class<K> keyClass, Type valueType) throws IOException, ClassNotFoundException - Throws:
IOExceptionClassNotFoundException
-
readObject
- Throws:
IOExceptionClassNotFoundException
-
readObject
- Throws:
IOExceptionClassNotFoundException
-
readObject
- Throws:
IOExceptionClassNotFoundException
-