Enum Class JBBPByteOrder

java.lang.Object
java.lang.Enum<JBBPByteOrder>
com.igormaznitsa.jbbp.io.JBBPByteOrder
All Implemented Interfaces:
Serializable, Comparable<JBBPByteOrder>, Constable

public enum JBBPByteOrder extends Enum<JBBPByteOrder>
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
  • Enum Constant Details

    • BIG_ENDIAN

      public static final JBBPByteOrder BIG_ENDIAN
      Big-endian: most significant byte first. Default in the DSL when no >/< prefix is written; explicit > is equivalent.
    • LITTLE_ENDIAN

      public static final JBBPByteOrder LITTLE_ENDIAN
      Little-endian: for multi-byte scalars, least significant byte is read/written first. For byte[]/ubyte[] array fields, the read or written chunk is reversed end-to-end so index 0 holds the least significant byte of the sequence.
  • Method Details

    • values

      public static JBBPByteOrder[] 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

      public static JBBPByteOrder valueOf(String name)
      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 name
      NullPointerException - if the argument is null