Class PrimitiveConverter

Object
org.anchoranalysis.image.voxel.buffer.primitive.PrimitiveConverter

public class PrimitiveConverter
extends Object
Type conversion between primitive data types.

This class is intended to help with conversion of elements retrieved from Buffer and its child-types.

Author:
Owen Feehan
  • Method Details

    • unsignedByteToInt

      public static int unsignedByteToInt​(byte value)
      Converts an unsigned-byte value to a signed int.
      Parameters:
      value - the value to convert.
      Returns:
      the converted value.
    • unsignedShortToInt

      public static int unsignedShortToInt​(short value)
      Converts an unsigned-short value to a signed int.
      Parameters:
      value - the value to convert.
      Returns:
      the converted value.
    • unsignedIntToShort

      public static int unsignedIntToShort​(int value)
      Converts an unsigned-int value to a signed int.
      Parameters:
      value - the value to convert.
      Returns:
      the converted value.
    • unsignedByteToShort

      public static int unsignedByteToShort​(byte value)
      Converts an unsigned-byte value to a signed short.
      Parameters:
      value - the value to convert.
      Returns:
      the converted value.
    • unsignedIntToLong

      public static long unsignedIntToLong​(int value)
      Converts an unsigned-int value to a signed long.
      Parameters:
      value - the value to convert.
      Returns:
      the converted value.
    • unsignedIntToInt

      public static int unsignedIntToInt​(int value)
      Converts an unsigned-int value to a signed int.
      Parameters:
      value - the value to convert.
      Returns:
      the converted value.