Class JsonReader
- java.lang.Object
-
- com.dslplatform.compiler.client.json.JsonReader
-
final class JsonReader extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]bufferprivate intcurrentIndexprivate bytelastprotected intlengthprivate char[]tmpprivate inttokenStartprivate static java.nio.charset.CharsetUTF_8private static boolean[]WHITESPACE
-
Constructor Summary
Constructors Modifier Constructor Description JsonReader(byte[] buffer, int length)JsonReader(byte[] buffer, int length, char[] tmp)privateJsonReader(char[] tmp, byte[] buffer, int length)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCurrentIndex()bytegetNextToken()intgetTokenStart()private static inthexToInt(byte value)(package private) booleanisEndOfStream()bytelast()intlength()longpositionInStream()byteread()char[]readNumber()java.lang.StringreadString()java.lang.StringtoString()booleanwasFalse()booleanwasNull()booleanwasTrue()private booleanwasWhiteSpace()
-
-
-
Field Detail
-
WHITESPACE
private static final boolean[] WHITESPACE
-
tokenStart
private int tokenStart
-
currentIndex
private int currentIndex
-
last
private byte last
-
length
protected int length
-
tmp
private final char[] tmp
-
buffer
private final byte[] buffer
-
UTF_8
private static final java.nio.charset.Charset UTF_8
-
-
Constructor Detail
-
JsonReader
private JsonReader(char[] tmp, byte[] buffer, int length)
-
JsonReader
public JsonReader(byte[] buffer, int length) throws java.io.IOException- Throws:
java.io.IOException
-
JsonReader
public JsonReader(byte[] buffer, int length, char[] tmp) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Detail
-
length
public int length()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
read
public byte read() throws java.io.IOException- Throws:
java.io.IOException
-
isEndOfStream
boolean isEndOfStream() throws java.io.IOException- Throws:
java.io.IOException
-
last
public final byte last()
-
getTokenStart
public final int getTokenStart()
-
getCurrentIndex
public final int getCurrentIndex()
-
readNumber
public final char[] readNumber()
-
readString
public final java.lang.String readString() throws java.io.IOException- Throws:
java.io.IOException
-
hexToInt
private static int hexToInt(byte value) throws java.io.IOException- Throws:
java.io.IOException
-
wasWhiteSpace
private boolean wasWhiteSpace()
-
getNextToken
public final byte getNextToken() throws java.io.IOException- Throws:
java.io.IOException
-
positionInStream
public final long positionInStream()
-
wasNull
public final boolean wasNull() throws java.io.IOException- Throws:
java.io.IOException
-
wasTrue
public final boolean wasTrue() throws java.io.IOException- Throws:
java.io.IOException
-
wasFalse
public final boolean wasFalse() throws java.io.IOException- Throws:
java.io.IOException
-
-