Class StreamingArrayRecord

java.lang.Object
org.apache.juneau.marshall.stream.StreamingArrayRecord

public final class StreamingArrayRecord extends Object
O(1)-memory wrappers that adapt a fine-grained TokenReader / TokenWriter to the array-element record-stream contract. Memory does not scale with the number of array elements — reading binds one element at a time; writing emits one element at a time.

For the reader: the wrapper opens an outer array via the cursor's TokenReader.next(), yields elements via TokenReader.read(Class) until TokenReader.canRead() returns false (end of array), then advances past the closing ] on close.

For the writer: the wrapper opens an outer array via TokenWriter.startArray(), forwards each write(...) call to TokenWriter.object(Object), and emits the closing ] via TokenWriter.endArray() on close.

Used by FULL-capability formats whose token cursor genuinely streams (json, json5, cbor, etc.). For PARTIAL formats whose token surface doesn't exist, see RecordAdapter.arrayReader(ParserSession, Object) / RecordAdapter.arrayWriter(org.apache.juneau.marshall.serializer.SerializerSession, java.lang.Object), which are buffered.