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 intprotected final PositionedByteRangeprotected final DataType[] -
Constructor Summary
ConstructorsConstructorDescriptionStructIterator(PositionedByteRange src, DataType[] types) ConstructStructIteratorover the values encoded insrcusing the specifiedtypesdefinition. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
src
-
idx
-
types
-
-
Constructor Details
-
StructIterator
ConstructStructIteratorover the values encoded insrcusing the specifiedtypesdefinition.- Parameters:
src- The buffer from which to read encoded values.types- The sequence of types to use as the schema for thisStruct.
-
-
Method Details