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.
|
InputStream |
nextBinaryStream()
Reads a binary stream 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.
IOException - If reading fails.void endObject()
throws IOException
beginObject().IOException - If reading fails.boolean hasNext()
throws IOException
IOException - If reading fails.int 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.
IOException - If reading fails.default boolean nextBoolean()
throws IOException
IOException - If reading fails.int nextInt()
throws IOException
IOException - If reading fails.int nextIntSigned()
throws IOException
IOException - If reading fails.int nextIntFixed()
throws IOException
IOException - If reading fails.long nextLong()
throws IOException
IOException - If reading fails.long nextLongSigned()
throws IOException
IOException - If reading fails.long nextLongFixed()
throws IOException
IOException - If reading fails.float nextFloat()
throws IOException
IOException - If reading fails.double nextDouble()
throws IOException
IOException - If reading fails.String nextString() throws IOException
String value.IOException - If reading fails.byte[] nextBinary()
throws IOException
The value might have been produced by DataWriter.value(byte[]), or
DataWriter.valueBinaryStream(). Best efficiency is achieved, if a value produced with
DataWriter.valueBinaryStream() is read by nextBinaryStream().
IOException - If reading fails.InputStream nextBinaryStream() throws IOException
The value might have been produced by DataWriter.value(byte[]), or
DataWriter.valueBinaryStream(). Best efficiency is achieved, if a value produced with
DataWriter.valueBinaryStream() is read by nextBinaryStream().
IOException - If reading fails.int beginArray()
throws IOException
IOException - If reading fails.void endArray()
throws IOException
beginArray().IOException - If reading fails.void skipValue()
throws IOException
IOException - If reading fails.Copyright © 2021. All rights reserved.