public class OctetDataReader extends Object implements DataReader
DataReader that reconstructs values written with a OctetDataWriter.| Constructor and Description |
|---|
OctetDataReader(InputStream in)
Creates a
OctetDataReader. |
| 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
DataReader.beginArray(). |
void |
endObject()
Finishes reading the object started with the last call to
DataReader.beginObject(). |
boolean |
hasNext()
|
byte[] |
nextBinary()
Reads a binary string value.
|
InputStream |
nextBinaryStream()
Reads a binary stream 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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitnextBooleanpublic OctetDataReader(InputStream in)
OctetDataReader.public void beginObject()
throws IOException
DataReader
After this call, an alternating sequence of calls to DataReader.nextName() followed by a value retrieval method
such as DataReader.nextInt(),... DataReader.nextString() followed by a final call to DataReader.endObject() is
expected.
beginObject in interface DataReaderIOException - If reading fails.public void endObject()
throws IOException
DataReaderDataReader.beginObject().endObject in interface DataReaderIOException - If reading fails.public boolean hasNext()
throws IOException
DataReaderhasNext in interface DataReaderIOException - If reading fails.public int nextName()
throws IOException
DataReaderreading an object, retrieves the next field identifier.
Note: DataReader.hasNext() must return true to be able to read the next field identifier.
nextName in interface DataReaderIOException - If reading fails.public int nextInt()
throws IOException
DataReadernextInt in interface DataReaderIOException - If reading fails.public int nextIntSigned()
throws IOException
DataReadernextIntSigned in interface DataReaderIOException - If reading fails.public int nextIntFixed()
throws IOException
DataReadernextIntFixed in interface DataReaderIOException - If reading fails.public long nextLong()
throws IOException
DataReadernextLong in interface DataReaderIOException - If reading fails.public long nextLongSigned()
throws IOException
DataReadernextLongSigned in interface DataReaderIOException - If reading fails.public long nextLongFixed()
throws IOException
DataReadernextLongFixed in interface DataReaderIOException - If reading fails.public float nextFloat()
throws IOException
DataReadernextFloat in interface DataReaderIOException - If reading fails.public double nextDouble()
throws IOException
DataReadernextDouble in interface DataReaderIOException - If reading fails.public String nextString() throws IOException
DataReaderString value.nextString in interface DataReaderIOException - If reading fails.public byte[] nextBinary()
throws IOException
DataReader
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 DataReader.nextBinaryStream().
nextBinary in interface DataReaderIOException - If reading fails.public InputStream nextBinaryStream() throws IOException
DataReader
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 DataReader.nextBinaryStream().
nextBinaryStream in interface DataReaderIOException - If reading fails.public int beginArray()
throws IOException
DataReaderbeginArray in interface DataReaderIOException - If reading fails.public void endArray()
throws IOException
DataReaderDataReader.beginArray().endArray in interface DataReaderIOException - If reading fails.public void skipValue()
throws IOException
DataReaderskipValue in interface DataReaderIOException - If reading fails.Copyright © 2021. All rights reserved.