MessageEncoder that encodes only a datum's bytes, without
additional information (such as a schema fingerprint).
This class is thread-safe.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| private static final ThreadLocal | |
| private static final ThreadLocal | |
| private final DatumWriter |
| Access | Constructor and Description |
|---|---|
| public | RawMessageEncoder(GenericData
the model, Schema data model for datum instancesthe schema)Schema for datum instancesCreates a new |
| public | RawMessageEncoder(GenericData
the model, Schema data model for datum instancesthe schema, boolean Schema for datum instanceswhether to copy buffers before returning encoded results shouldCopy)Creates a new |
| Modifier and Type | Method and Description |
|---|---|
| public ByteBuffer | encode(D
a datum datum)Implements org. |
| public void | encode(D
a datum datum, OutputStream an OutputStream to serialize the datum to stream)Implements org. |
| copyOutputBytes | back to summary |
|---|---|
| private final boolean copyOutputBytes | |
| ENCODER | back to summary |
|---|---|
| private static final ThreadLocal<BinaryEncoder> ENCODER | |
| TEMP | back to summary |
|---|---|
| private static final ThreadLocal<RawMessageEncoder. | |
| writer | back to summary |
|---|---|
| private final DatumWriter<D> writer | |
| RawMessageEncoder | back to summary |
|---|---|
| public RawMessageEncoder(GenericData model, Schema schema) Creates a new
Buffers returned by
| |
| RawMessageEncoder | back to summary |
|---|---|
| public RawMessageEncoder(GenericData model, Schema schema, boolean shouldCopy) Creates a new
If
If
| |
| encode | back to summary |
|---|---|
| public ByteBuffer encode(D datum) throws IOException Implements org. Doc from org. Serialize a single datum to a ByteBuffer.
| |
| encode | back to summary |
|---|---|
| public void encode(D datum, OutputStream stream) throws IOException Implements org. Doc from org. Serialize a single datum to an OutputStream.
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv ByteBuffer | |
| pack-priv ByteBuffer |
| BufferOutputStream | back to summary |
|---|---|
| pack-priv BufferOutputStream() | |
| toBufferWithCopy | back to summary |
|---|---|
| pack-priv ByteBuffer toBufferWithCopy() | |
| toBufferWithoutCopy | back to summary |
|---|---|
| pack-priv ByteBuffer toBufferWithoutCopy() | |