public enum BinaryLengthLength extends Enum<BinaryLengthLength>
writeLength(Bytes, long, long) exactly
once to store the final length.
Maximum storable lengths:
writeLength call performs a store fence as required by
JSR-133 to ensure the length is visible to other threads.| Enum Constant and Description |
|---|
LENGTH_16BIT
Represents a 16-bit length prefix.
|
LENGTH_32BIT
Represents a 32-bit length prefix allowing data up to 2,147,483,647 bytes.
|
LENGTH_8BIT
Represents an 8-bit length prefix capable of encoding data lengths from 0
to 255 bytes.
|
| Modifier and Type | Method and Description |
|---|---|
abstract int |
code()
Returns the
BinaryWireCode identifying
this length field in the binary stream. |
abstract long |
initialise(@NotNull BytesOut<?> bytes)
Writes the identifying code and reserves space for the length field.
|
static BinaryLengthLength |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static BinaryLengthLength[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
abstract void |
writeLength(@NotNull Bytes<?> bytes,
long positionReturnedFromInitialise,
long end)
Writes the actual length at the supplied offset after the data segment has
been written.
|
public static final BinaryLengthLength LENGTH_8BIT
public static final BinaryLengthLength LENGTH_16BIT
public static final BinaryLengthLength LENGTH_32BIT
public static BinaryLengthLength[] values()
for (BinaryLengthLength c : BinaryLengthLength.values()) System.out.println(c);
public static BinaryLengthLength valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic abstract int code()
BinaryWireCode identifying
this length field in the binary stream.public abstract long initialise(@NotNull
@NotNull BytesOut<?> bytes)
bytes - the output bytes to write topublic abstract void writeLength(@NotNull
@NotNull Bytes<?> bytes,
long positionReturnedFromInitialise,
long end)
bytes - the bytes to updatepositionReturnedFromInitialise - the offset from initialise(BytesOut)end - the absolute end of the dataCopyright © 2026 Chronicle Software Ltd. All rights reserved.