Class JsonInput
java.lang.Object
se.l4.commons.serialization.format.AbstractStreamingInput
se.l4.commons.serialization.format.JsonInput
- All Implemented Interfaces:
Closeable,AutoCloseable,StreamingInput
public class JsonInput extends AbstractStreamingInput
Input for JSON. Please note that this class is not intended for general use
and does not strictly conform to the JSON standard.
- Author:
- Andreas Holstenson
-
Field Summary
-
Constructor Summary
Constructors Constructor Description JsonInput(InputStream in)JsonInput(Reader in) -
Method Summary
Modifier and Type Method Description voidclose()byte[]getByteArray()Get the value as a byte[] array.Tokennext(Token expected)Advance to the next token checking that it is of a certain type.Tokennext0()Tokenpeek()Peek into the stream and return the next token.protected IOExceptionraiseException(String message)Methods inherited from class se.l4.commons.serialization.format.AbstractStreamingInput
current, getBoolean, getByte, getChar, getDouble, getFloat, getInt, getLong, getShort, getString, getValue, getValueType, next, raiseSerializationException, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueNull, skip, skipValue
-
Constructor Details
-
Method Details
-
close
- Throws:
IOException
-
raiseException
- Overrides:
raiseExceptionin classAbstractStreamingInput
-
next
Description copied from interface:StreamingInputAdvance to the next token checking that it is of a certain type.- Specified by:
nextin interfaceStreamingInput- Overrides:
nextin classAbstractStreamingInput- Returns:
- Throws:
IOException
-
next0
- Specified by:
next0in classAbstractStreamingInput- Throws:
IOException
-
peek
Description copied from interface:StreamingInputPeek into the stream and return the next token.- Returns:
- Throws:
IOException
-
getByteArray
public byte[] getByteArray()Description copied from interface:StreamingInputGet the value as a byte[] array.- Specified by:
getByteArrayin interfaceStreamingInput- Overrides:
getByteArrayin classAbstractStreamingInput- Returns:
-