Class CborTokenWriter

java.lang.Object
org.apache.juneau.marshall.cbor.CborTokenWriter
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable, RecordWriter, TokenWriter

public class CborTokenWriter extends Object implements TokenWriter
Reference implementation of the public TokenWriter surface for the CBOR format (RFC 8949).

Wraps a CborOutputStream and emits **indefinite-length** containers (0xBF for maps, 0x9F for arrays, terminated by 0xFF BREAK) so that the caller doesn't have to know element counts up front — a natural fit for streaming generation.

Notes:
  • This class is not thread safe.
  • byte[] values dispatch to native CBOR major-type-2 byte strings via CborOutputStream.appendBinary(byte[]), not to a base64 string fallback.
  • The writer is purely structural; object swaps and @Schema annotations are NOT applied at the token layer (see TokenWriter.object(Object) for the bridge that does apply them).