Package de.pco.common

Class UByteArray


public class UByteArray
extends AbstractUnsignedArray
Class that represent the unsigned byte array.
Author:
PCO
  • Field Summary

    Fields
    Modifier and Type Field Description
    static int ELEMENT_MAX_VALUE  

    Fields inherited from class de.pco.common.AbstractUnsignedArray

    buffer
  • Constructor Summary

    Constructors
    Constructor Description
    UByteArray​(byte[] byteArray)
    Loads the data from the (signed) byte array, where the particular byte values are to be interpreted as the unsigned values
    UByteArray​(int[] intArray)
    Loads the data from the int array that should actually store the unsigned bytes.
  • Method Summary

    Modifier and Type Method Description
    int[] getArray()
    Returns the array of the unsigned byte values in an int array
    byte[] getBackingArray()
    Returns the (signed) sequence of bytes from the buffer as an array.
    int length()
    Returns the number of values stored.

    Methods inherited from class de.pco.common.AbstractUnsignedArray

    equals, getInputStream, hashCode, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • UByteArray

      public UByteArray​(byte[] byteArray)
      Loads the data from the (signed) byte array, where the particular byte values are to be interpreted as the unsigned values
      Parameters:
      byteArray -
    • UByteArray

      public UByteArray​(int[] intArray) throws IllegalArgumentException
      Loads the data from the int array that should actually store the unsigned bytes. Checks whether the values are in the range.
      Parameters:
      intArray -
      Throws:
      IllegalArgumentException
  • Method Details

    • getArray

      public int[] getArray()
      Returns the array of the unsigned byte values in an int array
      Specified by:
      getArray in class AbstractUnsignedArray
      Returns:
    • getBackingArray

      public byte[] getBackingArray()
      Returns the (signed) sequence of bytes from the buffer as an array. This method is to be used in the ImageIO framework.
      Specified by:
      getBackingArray in class AbstractUnsignedArray
      Returns:
    • length

      public int length()
      Returns the number of values stored.
      Specified by:
      length in class AbstractUnsignedArray
      Returns: