Interface ArrayRecordWritable
- All Known Implementing Classes:
BsonSerializer,BsonSerializer.Base64,BsonSerializer.SpacedHex,BsonSerializerSession,CborSerializer,CborSerializer.Base64,CborSerializer.SpacedHex,CborSerializerSession,JcsSerializer,JcsSerializerSession,Json5lSerializer,Json5lSerializerSession,Json5Serializer,Json5Serializer.Readable,Json5SerializerSession,JsonlSerializer,JsonlSerializerSession,JsonSchemaSerializer,JsonSchemaSerializer.Readable,JsonSchemaSerializerSession,JsonSerializer,JsonSerializer.Readable,JsonSerializerSession,MsgPackSerializer,MsgPackSerializer.Base64,MsgPackSerializer.SpacedHex,MsgPackSerializerSession,ParquetSerializer,ParquetSerializerSession,YamlSerializer,YamlSerializer.Readable,YamlSerializerSession
public interface ArrayRecordWritable
Capability role for serializers that can emit each element of a top-level wire array as a
separate record.
The symmetric writer-side counterpart of ArrayRecordReadable. Capability is detected
via instanceof.
See Also:
ArrayRecordReadable— the symmetric reader role.- Serializers and Parsers
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanStreaming-quality signal queryable before opening a cursor.writeArrayRecords(Object output) Opens aRecordWriterthat wraps eachwrite(...)call as one element of a top-level wire array.default RecordWriterwriteArrayRecords(Object output, int expectedCount) Variant ofwriteArrayRecords(Object)for length-prefixed binary formats that require the element count up front (msgpack, bson).
-
Method Details
-
writeArrayRecords
Opens aRecordWriterthat wraps eachwrite(...)call as one element of a top-level wire array.- Parameters:
output- The output.- Returns:
- A new element-streamed
RecordWriter. - Throws:
IOException- If a problem occurred opening the underlying output.
-
writeArrayRecords
Variant ofwriteArrayRecords(Object)for length-prefixed binary formats that require the element count up front (msgpack, bson). Other formats may ignore the count and behave the same aswriteArrayRecords(Object).- Parameters:
output- The output.expectedCount- The number of elements that will be written. Must match the number ofRecordWriter.write(Object)calls beforeRecordWriter.close().- Returns:
- A new element-streamed
RecordWriter. - Throws:
IOException- If a problem occurred opening the underlying output.
-
isArrayRecordStreaming
Streaming-quality signal queryable before opening a cursor.- Returns:
true for true element streaming (json/cbor/msgpack);false for the bufferedRecordAdapter.arrayWriter(org.apache.juneau.marshall.serializer.SerializerSession, java.lang.Object)-backed formats (yaml, parquet, bson).
-