Class ProductData.UByte

  • All Implemented Interfaces:
    Cloneable
    Enclosing class:
    ProductData

    public static class ProductData.UByte
    extends ProductData.Byte
    The UByte class is a ProductData specialisation for unsigned 8-bit integer fields.

    Internally, data is stored in an array of the type byte[].

    In order to preserve the accuracy for the unsigned byte value range the getElemIntAt method should be used to retrieve the data stored in this value instead of accessing the data array directly.

    Another method is to mask each of the array elements in order to get the unsigned type in the following way:

         byte[] data = (byte[]) value.getElems();
         for (int i = 0; i < data.length; i++) {
             int value = data[i] & 0xff;
             ...
         }
     
    • Constructor Detail

      • UByte

        public UByte​(int numElems)
        Constructs a new unsigned byte value.
        Parameters:
        numElems - the number of elements, must not be less than one
      • UByte

        public UByte​(byte[] array)
        Constructs a new unsigned byte value.
        Parameters:
        array - the elements