Class StructIterator
Iterator
over encoded Struct
members.
This iterates over each serialized Struct
field from the specified DataTypes<?>[]
definition. It allows you to read the field or skip over its serialized bytes using
next()
and skip()
, respectively. This is in contrast to the Struct
method which allow you to Struct.decode(PositionedByteRange)
or
Struct.skip(PositionedByteRange)
over the entire Struct
at once.
This iterator may also be used to read bytes from any Struct
for which the specified
DataType<?>[]
is a prefix. For example, if the specified Struct
definition has a
RawInteger
and a RawStringTerminated
field, you may parse the serialized output
of a Struct
whose fields are RawInteger
, RawStringTerminated
, and
RawBytes
. The iterator would return a number followed by a String
. The trailing
byte[]
would be ignored.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
protected final PositionedByteRange
protected final DataType[]
-
Constructor Summary
ConstructorsConstructorDescriptionStructIterator
(PositionedByteRange src, DataType[] types) ConstructStructIterator
over the values encoded insrc
using the specifiedtypes
definition. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
src
-
idx
-
types
-
-
Constructor Details
-
StructIterator
ConstructStructIterator
over the values encoded insrc
using the specifiedtypes
definition.- Parameters:
src
- The buffer from which to read encoded values.types
- The sequence of types to use as the schema for thisStruct
.
-
-
Method Details