Class PrimitiveConverter
Object
PrimitiveConverter
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 Summary
Modifier and TypeMethodDescriptionstatic intunsignedByteToInt(byte value) Converts an unsigned-byte value to a signed int.static intunsignedByteToShort(byte value) Converts an unsigned-byte value to a signed short.static intunsignedIntToInt(int value) Converts an unsigned-int value to a signed int.static longunsignedIntToLong(int value) Converts an unsigned-int value to a signed long.static intunsignedIntToShort(int value) Converts an unsigned-int value to a signed int.static intunsignedShortToInt(short value) Converts an unsigned-short value to a signed int.
-
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.
-