ByteOrder (Media Authoring with Java API)
Date: 2016-02-05

tv.amwa.maj.enumeration

## Enum ByteOrder

- java.lang.Object
- - java.lang.Enum<ByteOrder>
  - - tv.amwa.maj.enumeration.ByteOrder

- All Implemented Interfaces:
    Serializable, Comparable<ByteOrder>, MediaEnumerationValue

      public enum ByteOrder
      extends Enum<ByteOrder>
      implements MediaEnumerationValue

  Specifies the byte order of a file, such as an AAF file. A ByteOrder property records the byte order of the computer platform on which the file was created. Subsequent modification of the file may create objects with foreign byte order; the byte order of individual modified objects shall be properly maintained by the storage format.

  In the big-endian byte order, the most significant byte is stored first at the address specified, which is the lowest address of the series of bytes that constitute the value. In the little-endian byte order, the least-significant byte is stored first. In both cases, each individual byte is stored with the most-significant bit first.

  Note that the AAF object specification v1.1 uses an `Int16` value to represent byte order. This value can be retrieved using `getAAFByteOrderCode()` method and converted back to a value of this enumeration using `getByteOrderFromAAFCode(short)`.

  Original C name: `eByteOrder_e`

  See Also:
    `Preface`, `TypeDefinitionStream`

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `Big` Big-endian byte order, where the most significant byte is stored first.
    `Little` Little-endian byte order, where the least significant byte is stored first.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `short` | `getAAFByteOrderCode()` Returns the code used to represent this byte order in an AAF file.
    `static ByteOrder` | `getByteOrderFromAAFCode(short code)` Returns a value of this enumeration matching the given byte order code from an AAF file.
    `String` | `symbol()` Provides a name for the enumeration value that can be used in XML serialisation.
    `long` | `value()` Returns the unique integer value associated with an enumeration value, either according to the AAF specification and/or the current AAF meta dictionary.
    `static ByteOrder` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static ByteOrder[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface tv.amwa.maj.industry.MediaEnumerationValue

      `name`

- - ### Enum Constant Detail

    - #### Little

          public static final ByteOrder Little

      Little-endian byte order, where the least significant byte is stored first.

      The code used in AAF file to represent little-endian byte order is 0x6c6c ('`ll`').

    - #### Big

          public static final ByteOrder Big

      Big-endian byte order, where the most significant byte is stored first.

      The code used in AAF file to represent big-endian byte order is 0x4d4d ('`MM`').

  - ### Method Detail

    - #### values

          public static ByteOrder[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (ByteOrder c : ByteOrder.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static ByteOrder valueOf(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
        `NullPointerException` - if the argument is null

    - #### value

          @Int64
          public long value()

      Description copied from interface: `MediaEnumerationValue`

      Returns the unique integer value associated with an enumeration value, either according to the AAF specification and/or the current AAF meta dictionary.

      Specified by:
        `value` in interface `MediaEnumerationValue`
      Returns:
        Unique integer value associated with an enumeration constant.

    - #### symbol

          public String symbol()

      Description copied from interface: `MediaEnumerationValue`

      Provides a name for the enumeration value that can be used in XML serialisation. The name is unique within the namespace of the owning type.

      As an example, the `ChannelStatusModeType` value `ChannelStatusModeType.Fixed` value has the name "`Fixed`" and symbol "`ChannelStatusMode_Fixed`".

      Specified by:
        `symbol` in interface `MediaEnumerationValue`
      Returns:
        Symbol name for this enumeration value.

    - #### getAAFByteOrderCode

          @Int16
          public short getAAFByteOrderCode()

      Returns the code used to represent this byte order in an AAF file.

      Returns:
        Code used to represent this byte order in an AAF file.

    - #### getByteOrderFromAAFCode

          public static final ByteOrder getByteOrderFromAAFCode(@Int16
                                                                short code)
                                                         throws IllegalArgumentException

      Returns a value of this enumeration matching the given byte order code from an AAF file.

      Parameters:
        `code` - Code used to represent byte order from an AAF file.
      Returns:
        Element of this enumeration representing the given code.
      Throws:
        `IllegalArgumentException` - The given value is not recognised as one of the codes representing byte order in an AAF file.

(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.