Class LongField

  • All Implemented Interfaces:
    FixedField

    public class LongField
    extends Object
    implements FixedField
    representation of a long (16-bit) field at a fixed location within a byte array
    • Constructor Summary

      Constructors 
      Constructor Description
      LongField​(int offset)
      construct the LongField with its offset into its containing byte array
      LongField​(int offset, byte[] data)
      Construct the LongField with its offset into its containing byte array and initialize its value from its byte array
      LongField​(int offset, long value)
      construct the LongField with its offset into its containing byte array and initialize its value
      LongField​(int offset, long value, byte[] data)
      construct the LongField with its offset into its containing byte array, initialize its value, and write the value to a byte array
    • Constructor Detail

      • LongField

        public LongField​(int offset,
                         long value)
                  throws ArrayIndexOutOfBoundsException
        construct the LongField with its offset into its containing byte array and initialize its value
        Parameters:
        offset - of the field within its byte array
        value - the initial value
        Throws:
        ArrayIndexOutOfBoundsException - if offset is negative
      • LongField

        public LongField​(int offset,
                         byte[] data)
                  throws ArrayIndexOutOfBoundsException
        Construct the LongField with its offset into its containing byte array and initialize its value from its byte array
        Parameters:
        offset - of the field within its byte array
        data - the byte array to read the value from
        Throws:
        ArrayIndexOutOfBoundsException - if the offset is not within the range of 0..(data.length - 1)
      • LongField

        public LongField​(int offset,
                         long value,
                         byte[] data)
                  throws ArrayIndexOutOfBoundsException
        construct the LongField with its offset into its containing byte array, initialize its value, and write the value to a byte array
        Parameters:
        offset - of the field within its byte array
        value - the initial value
        data - the byte array to write the value to
        Throws:
        ArrayIndexOutOfBoundsException - if offset is negative