Package de.pco.common
Class UByteArray
java.lang.Object
de.pco.common.AbstractUnsignedArray
de.pco.common.UByteArray
public class UByteArray extends AbstractUnsignedArray
Class that represent the unsigned byte array.
- Author:
- PCO
-
Field Summary
Fields Modifier and Type Field Description static intELEMENT_MAX_VALUEFields 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 valuesUByteArray(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 arraybyte[]getBackingArray()Returns the (signed) sequence of bytes from the buffer as an array.intlength()Returns the number of values stored.Methods inherited from class de.pco.common.AbstractUnsignedArray
equals, getInputStream, hashCode, toString
-
Field Details
-
ELEMENT_MAX_VALUE
public static final int ELEMENT_MAX_VALUE- See Also:
- Constant Field Values
-
-
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
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:
getArrayin classAbstractUnsignedArray- 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:
getBackingArrayin classAbstractUnsignedArray- Returns:
-
length
public int length()Returns the number of values stored.- Specified by:
lengthin classAbstractUnsignedArray- Returns:
-