MessageDecoder that deserializes from raw datum bytes.
This class uses the schema passed to its constructor when decoding buffers.
To decode buffers that have different schemas, use
BinaryMessageEncoder and BinaryMessageDecoder.
This will not throw BadHeaderException because it expects no header,
and will not throw MissingSchemaException because it always uses the
read schema from its constructor.
This class is thread-safe.
| Modifier and Type | Field and Description |
|---|---|
| private static final ThreadLocal | |
| private final DatumReader |
| Access | Constructor and Description |
|---|---|
| public | RawMessageDecoder(GenericData
the model, Schema data model for datum instancesthe schema)Schema used to construct datum instances and to
decode buffers.Creates a new |
| public | RawMessageDecoder(GenericData
the model, Schema data model for datum instancesthe writeSchema, Schema Schema used to decode buffersthe readSchema)Schema used to construct datum instancesCreates a new |
| Modifier and Type | Method and Description |
|---|---|
| public D | decode(InputStream
stream to read from stream, D a datum instance to reuse, avoiding instantiation if possible reuse)Implements org. |
| DECODER | back to summary |
|---|---|
| private static final ThreadLocal<BinaryDecoder> DECODER | |
| reader | back to summary |
|---|---|
| private final DatumReader<D> reader | |
| RawMessageDecoder | back to summary |
|---|---|
| public RawMessageDecoder(GenericData model, Schema schema) Creates a new
The
| |
| RawMessageDecoder | back to summary |
|---|---|
| public RawMessageDecoder(GenericData model, Schema writeSchema, Schema readSchema) Creates a new
The
| |
| decode | back to summary |
|---|---|
| public D decode(InputStream stream, D reuse) Implements org. Doc from org. Deserialize a single datum from an InputStream.
| |