T - type being marshalledpublic class BytesMarshaller<T> extends Object
FieldAccess
helpers. This approach is generic but slower than hand-written marshalling.| Modifier and Type | Field and Description |
|---|---|
static net.openhft.chronicle.core.util.ClassLocal<BytesMarshaller> |
BYTES_MARSHALLER_CL
Provides a ClassLocal instance for holding a unique BytesMarshaller for each class.
|
| Constructor and Description |
|---|
BytesMarshaller(@NotNull Class<T> tClass)
Constructs a BytesMarshaller for the specified class.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
getAllField(@NotNull Class<?> clazz,
@NotNull Map<String,Field> map)
Extracts all fields from the specified class and its superclasses and stores
them in the provided map.
|
void |
readMarshallable(ReadBytesMarshallable t,
BytesIn<?> in)
Populates
t by reading each field from in using reflection. |
void |
writeMarshallable(WriteBytesMarshallable t,
BytesOut<?> out)
Writes all fields of
t to out using reflection. |
public static final net.openhft.chronicle.core.util.ClassLocal<BytesMarshaller> BYTES_MARSHALLER_CL
public static void getAllField(@NotNull
@NotNull Class<?> clazz,
@NotNull
@NotNull Map<String,Field> map)
clazz - the class from which to extract fields.map - the map in which to store the fields.public void readMarshallable(ReadBytesMarshallable t, BytesIn<?> in) throws net.openhft.chronicle.core.io.InvalidMarshallableException
t by reading each field from in using reflection.net.openhft.chronicle.core.io.InvalidMarshallableExceptionpublic void writeMarshallable(WriteBytesMarshallable t, BytesOut<?> out) throws IllegalArgumentException, net.openhft.chronicle.core.io.ClosedIllegalStateException, BufferOverflowException, BufferUnderflowException, ArithmeticException, net.openhft.chronicle.core.io.InvalidMarshallableException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
t to out using reflection.IllegalArgumentExceptionnet.openhft.chronicle.core.io.ClosedIllegalStateExceptionBufferOverflowExceptionBufferUnderflowExceptionArithmeticExceptionnet.openhft.chronicle.core.io.InvalidMarshallableExceptionnet.openhft.chronicle.core.io.ThreadingIllegalStateExceptionCopyright © 2026 Chronicle Software Ltd. All rights reserved.