public interface DataReader
A message constructed by a DataWriter may only contain object at
top-level. Therefore the first call to an instance of DataReader must
be beginObject().
DataWriter| Modifier and Type | Method and Description |
|---|---|
int |
beginArray()
Starts reading an array.
|
void |
beginObject()
Starts reading an object.
|
void |
endArray()
Finishes reading the array started with
beginArray(). |
void |
endObject()
Finishes reading the object started with the last call to
beginObject(). |
boolean |
hasNext()
|
byte[] |
nextBinary()
Reads a binary string value.
|
default boolean |
nextBoolean()
Reads a boolean value.
|
double |
nextDouble()
Reads a 64 bit double value.
|
float |
nextFloat()
Reads a 32 bit float value.
|
int |
nextInt()
Reads an (unsigned) integer value.
|
int |
nextIntFixed()
Reads a full 32 bit integer value.
|
int |
nextIntSigned()
Reads a signed integer value.
|
long |
nextLong()
Reads an (unsigned) long value.
|
long |
nextLongFixed()
Reads a full 64 bit long value.
|
long |
nextLongSigned()
Reads a signed long value.
|
int |
nextName()
When
reading an object, retrieves the next field
identifier. |
String |
nextString()
Reads an utf-8
String value. |
void |
skipValue()
Skips the current value to read.
|
void beginObject()
throws IOException
After this call, an alternating sequence of calls to nextName()
followed by a value retrieval method such as nextInt(),...
nextString() followed by a final call to endObject() is
expected.
IOExceptionvoid endObject()
throws IOException
beginObject().IOExceptionboolean hasNext()
throws IOException
IOExceptionint nextName()
throws IOException
reading an object, retrieves the next field
identifier.
Note: hasNext() must return true to be able to read
the next field identifier.
IOExceptiondefault boolean nextBoolean()
throws IOException
IOExceptionint nextInt()
throws IOException
IOExceptionint nextIntSigned()
throws IOException
IOExceptionint nextIntFixed()
throws IOException
IOExceptionlong nextLong()
throws IOException
IOExceptionlong nextLongSigned()
throws IOException
IOExceptionlong nextLongFixed()
throws IOException
IOExceptionfloat nextFloat()
throws IOException
IOExceptiondouble nextDouble()
throws IOException
IOExceptionString nextString() throws IOException
String value.IOExceptionbyte[] nextBinary()
throws IOException
IOExceptionint beginArray()
throws IOException
IOExceptionvoid endArray()
throws IOException
beginArray().IOExceptionvoid skipValue()
throws IOException
IOExceptionCopyright © 2021. All rights reserved.