Package com.igormaznitsa.jbbp.io
Enum Class JBBPByteOrder
- All Implemented Interfaces:
Serializable,Comparable<JBBPByteOrder>,Constable
Byte order for multi-byte numeric values and for raw byte/ubyte array chunks in the DSL.
In scripts, > selects BIG_ENDIAN and may be omitted (default). <
selects LITTLE_ENDIAN. For JBBPBitInputStream.readByteArray(int, JBBPByteOrder)
and JBBPBitOutputStream.writeBytes(byte[], int, JBBPByteOrder), the chunk is treated as
one byte sequence: big-endian keeps stream index order; little-endian reverses that sequence
so the logical value matches usual LE layout (least significant byte at the lowest index).
- Since:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionBig-endian: most significant byte first.Little-endian: for multi-byte scalars, least significant byte is read/written first. -
Method Summary
Modifier and TypeMethodDescriptionstatic JBBPByteOrderReturns the enum constant of this class with the specified name.static JBBPByteOrder[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BIG_ENDIAN
Big-endian: most significant byte first. Default in the DSL when no>/<prefix is written; explicit>is equivalent. -
LITTLE_ENDIAN
Little-endian: for multi-byte scalars, least significant byte is read/written first. Forbyte[]/ubyte[]array fields, the read or written chunk is reversed end-to-end so index0holds the least significant byte of the sequence.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-