Class OracleOsonDecoder

All Implemented Interfaces:
Decoder, AutoCloseable

@Internal public final class OracleOsonDecoder extends AbstractStreamDecoder
A serde stream decoder that reads Oracle's binary JSON (OSON) in place from a byte array: no DOM, no event objects, no copy of the document. It is the fast path for Oracle JSON columns, where the driver already holds the encoded document (OracleJsonDatum.shareBytes()).

The layout is a header with flags, a field name dictionary, and a tree segment of nodes whose containers hold child field ids and offsets. Knowledge of that layout comes from the published open source python-oracledb driver (Apache / UPL licensed, impl/base/oson.pyx), not from the Oracle JDBC driver, whose license forbids decompilation. Field names are interned through an OracleOsonFieldNameCache so a stream of documents with the same shape allocates no name strings after the first. Requires the AL32UTF8 database character set, which is what Oracle 23ai and later use for JSON.

Dates, timestamps, intervals, binary values and ids are reported as AbstractStreamDecoder.TokenType.OTHER, as the OracleJdbcJsonParserDecoder reports them, so they are never read as numbers. Read as strings they use the formats of the parser path: ISO-8601 dates and timestamps that always carry seconds, durations with a days part, upper case hexadecimal for binary values and lower case for ids. VECTOR values are not supported and fail when read.

Since:
3.3.0