Package com.irurueta.geometry.io
Class Util
java.lang.Object
com.irurueta.geometry.io.Util
Utility methods for I/O operations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static doublefromBigEndian(double value) Converts value from big endian to machine native endian type (in Java native endian type is always Big endian, for that reason this method has no effect).(package private) static floatfromBigEndian(float value) Converts value from big endian to machine native endian type (in Java native endian type is always Big endian, for that reason this method has no effect).(package private) static intfromBigEndian(int value) Converts value from big endian to machine native endian type (in Java native endian type is always Big endian, for that reason this method has no effect).(package private) static longfromBigEndian(long value) Converts value from big endian to machine native endian type (in Java native endian type is always Big endian, for that reason this method has no effect).(package private) static shortfromBigEndian(short value) Converts value from big endian to machine native endian type (in Java native endian type is always Big endian, for that reason this method has no effect).(package private) static doublefromEndianType(EndianType endianType, double value) Converts provided value from provided endian type to machine native endian type (in Java native endian type is always big endian).(package private) static floatfromEndianType(EndianType endianType, float value) Converts provided value from provided endian type to machine native endian type (in Java native endian type is always big endian).(package private) static intfromEndianType(EndianType endianType, int value) Converts provided value from provided endian type to machine native endian type (in Java native endian type is always big endian).(package private) static longfromEndianType(EndianType endianType, long value) Converts provided value from provided endian type to machine native endian type (in Java native endian type is always big endian).(package private) static shortfromEndianType(EndianType endianType, short value) Converts provided value from provided endian type to machine native endian type (in Java native endian type is always big endian).(package private) static doublefromLittleEndian(double value) Converts value from little endian to machine native endian type (in Java native endian type is always Big endian).(package private) static floatfromLittleEndian(float value) Converts value from little endian to machine native endian type (in Java native endian type is always Big endian).(package private) static intfromLittleEndian(int value) Converts value from little endian to machine native endian type (in Java native endian type is always Big endian).(package private) static longfromLittleEndian(long value) Converts value from little endian to machine native endian type (in Java native endian type is always Big endian).(package private) static shortfromLittleEndian(short value) Converts value from little endian to machine native endian type (in Java native endian type is always Big endian).(package private) static doubletoBigEndian(double value) Converts provided value to big endian.(package private) static floattoBigEndian(float value) Converts provided value to big endian.(package private) static inttoBigEndian(int value) Converts provided value to big endian.(package private) static longtoBigEndian(long value) Converts provided value to big endian.(package private) static shorttoBigEndian(short value) Converts provided value to big endian.(package private) static doubletoEndianType(EndianType endianType, double value) Converts provided value to provided endian type.(package private) static floattoEndianType(EndianType endianType, float value) Converts provided value to provided endian type.(package private) static inttoEndianType(EndianType endianType, int value) Converts provided value to provided endian type.(package private) static longtoEndianType(EndianType endianType, long value) Converts provided value to provided endian type.(package private) static shorttoEndianType(EndianType endianType, short value) Converts provided value to provided endian type.(package private) static doubletoLittleEndian(double value) Converts provided value to little endian.(package private) static floattoLittleEndian(float value) Converts provided value to little endian.(package private) static inttoLittleEndian(int value) Converts provided value to little endian.(package private) static longtoLittleEndian(long value) Converts provided value to little endian.(package private) static shorttoLittleEndian(short value) Converts provided value to little endian.
-
Constructor Details
-
Util
private Util()Constructor. Prevents instantiation.
-
-
Method Details
-
toBigEndian
static short toBigEndian(short value) Converts provided value to big endian. NOTE: Java virtual machine always uses big endian values, so this method has no effect.- Parameters:
value- Value to be converted to big endian.- Returns:
- Converted value.
-
toLittleEndian
static short toLittleEndian(short value) Converts provided value to little endian. Little endian puts high bytes last, or in other words, byte order is reversed.- Parameters:
value- Value to be converted to little endian.- Returns:
- Converted value.
-
toEndianType
Converts provided value to provided endian type. Little endian puts high bytes last (having reversed byte order), and big endian puts high bytes first (following natural binary order).- Parameters:
endianType- Endian type.value- Value to be converted.- Returns:
- Converted value.
-
fromBigEndian
static short fromBigEndian(short value) Converts value from big endian to machine native endian type (in Java native endian type is always Big endian, for that reason this method has no effect).- Parameters:
value- Value to be converted.- Returns:
- Converted value.
-
fromLittleEndian
static short fromLittleEndian(short value) Converts value from little endian to machine native endian type (in Java native endian type is always Big endian). Little endian puts high bytes last, so byte order has to be reversed to convert to native machine endian type. Big endian preserves natural byte order (high bytes first).- Parameters:
value- Value to be converted.- Returns:
- Converted value.
-
fromEndianType
Converts provided value from provided endian type to machine native endian type (in Java native endian type is always big endian). Little endian puts high bytes last, so byte order has to be reversed to convert to native machine endian. Big endian preserves natural byte order (high bytes first).- Parameters:
endianType- Endian type.value- Value to be converted.- Returns:
- Converted value.
-
toBigEndian
static int toBigEndian(int value) Converts provided value to big endian. NOTE: Java virtual machine always uses big endian values, so this method has no effect.- Parameters:
value- Value to be converted to big endian.- Returns:
- Converted value.
-
toLittleEndian
static int toLittleEndian(int value) Converts provided value to little endian. Little endian puts high bytes last, or in other words, byte order is reversed.- Parameters:
value- Value to be converted to little endian.- Returns:
- Converted value.
-
toEndianType
Converts provided value to provided endian type. Little endian puts high bytes last (having reversed byte order), and big endian puts high bytes first (following natural binary order).- Parameters:
endianType- Endian type.value- Value to be converted.- Returns:
- Converted value.
-
fromBigEndian
static int fromBigEndian(int value) Converts value from big endian to machine native endian type (in Java native endian type is always Big endian, for that reason this method has no effect).- Parameters:
value- Value to be converted.- Returns:
- Converted value.
-
fromLittleEndian
static int fromLittleEndian(int value) Converts value from little endian to machine native endian type (in Java native endian type is always Big endian). Little endian puts high bytes last, so byte order has to be reversed to convert to native machine endian type. Big endian preserves natural byte order (high bytes first).- Parameters:
value- Value to be converted.- Returns:
- Converted value.
-
fromEndianType
Converts provided value from provided endian type to machine native endian type (in Java native endian type is always big endian). Little endian puts high bytes last, so byte order has to be reversed to convert to native machine endian. Big endian preserves natural byte order (high bytes first).- Parameters:
endianType- Endian type.value- Value to be converted.- Returns:
- Converted value.
-
toBigEndian
static long toBigEndian(long value) Converts provided value to big endian. NOTE: Java virtual machine always uses big endian values, so this method has no effect.- Parameters:
value- Value to be converted to big endian.- Returns:
- Converted value.
-
toLittleEndian
static long toLittleEndian(long value) Converts provided value to little endian. Little endian puts high bytes last, or in other words, byte order is reversed.- Parameters:
value- Value to be converted to little endian.- Returns:
- Converted value.
-
toEndianType
Converts provided value to provided endian type. Little endian puts high bytes last (having reversed byte order), and big endian puts high bytes first (following natural binary order).- Parameters:
endianType- Endian type.value- Value to be converted.- Returns:
- Converted value.
-
fromBigEndian
static long fromBigEndian(long value) Converts value from big endian to machine native endian type (in Java native endian type is always Big endian, for that reason this method has no effect).- Parameters:
value- Value to be converted.- Returns:
- Converted value.
-
fromLittleEndian
static long fromLittleEndian(long value) Converts value from little endian to machine native endian type (in Java native endian type is always Big endian). Little endian puts high bytes last, so byte order has to be reversed to convert to native machine endian type. Big endian preserves natural byte order (high bytes first).- Parameters:
value- Value to be converted.- Returns:
- Converted value.
-
fromEndianType
Converts provided value from provided endian type to machine native endian type (in Java native endian type is always big endian). Little endian puts high bytes last, so byte order has to be reversed to convert to native machine endian. Big endian preserves natural byte order (high bytes first).- Parameters:
endianType- Endian type.value- Value to be converted.- Returns:
- Converted value.
-
toBigEndian
static float toBigEndian(float value) Converts provided value to big endian. NOTE: Java virtual machine always uses big endian values, so this method has no effect.- Parameters:
value- Value to be converted to big endian.- Returns:
- Converted value.
-
toLittleEndian
static float toLittleEndian(float value) Converts provided value to little endian. Little endian puts high bytes last, or in other words, byte order is reversed.- Parameters:
value- Value to be converted to little endian.- Returns:
- Converted value.
-
toEndianType
Converts provided value to provided endian type. Little endian puts high bytes last (having reversed byte order), and big endian puts high bytes first (following natural binary order).- Parameters:
endianType- Endian type.value- Value to be converted.- Returns:
- Converted value.
-
fromBigEndian
static float fromBigEndian(float value) Converts value from big endian to machine native endian type (in Java native endian type is always Big endian, for that reason this method has no effect).- Parameters:
value- Value to be converted.- Returns:
- Converted value.
-
fromLittleEndian
static float fromLittleEndian(float value) Converts value from little endian to machine native endian type (in Java native endian type is always Big endian). Little endian puts high bytes last, so byte order has to be reversed to convert to native machine endian type. Big endian preserves natural byte order (high bytes first).- Parameters:
value- Value to be converted.- Returns:
- Converted value.
-
fromEndianType
Converts provided value from provided endian type to machine native endian type (in Java native endian type is always big endian). Little endian puts high bytes last, so byte order has to be reversed to convert to native machine endian. Big endian preserves natural byte order (high bytes first).- Parameters:
endianType- Endian type.value- Value to be converted.- Returns:
- Converted value.
-
toBigEndian
static double toBigEndian(double value) Converts provided value to big endian. NOTE: Java virtual machine always uses big endian values, so this method has no effect.- Parameters:
value- Value to be converted to big endian.- Returns:
- Converted value.
-
toLittleEndian
static double toLittleEndian(double value) Converts provided value to little endian. Little endian puts high bytes last, or in other words, byte order is reversed.- Parameters:
value- Value to be converted to little endian.- Returns:
- Converted value.
-
toEndianType
Converts provided value to provided endian type. Little endian puts high bytes last (having reversed byte order), and big endian puts high bytes first (following natural binary order).- Parameters:
endianType- Endian type.value- Value to be converted.- Returns:
- Converted value.
-
fromBigEndian
static double fromBigEndian(double value) Converts value from big endian to machine native endian type (in Java native endian type is always Big endian, for that reason this method has no effect).- Parameters:
value- Value to be converted.- Returns:
- Converted value.
-
fromLittleEndian
static double fromLittleEndian(double value) Converts value from little endian to machine native endian type (in Java native endian type is always Big endian). Little endian puts high bytes last, so byte order has to be reversed to convert to native machine endian type. Big endian preserves natural byte order (high bytes first).- Parameters:
value- Value to be converted.- Returns:
- Converted value.
-
fromEndianType
Converts provided value from provided endian type to machine native endian type (in Java native endian type is always big endian). Little endian puts high bytes last, so byte order has to be reversed to convert to native machine endian. Big endian preserves natural byte order (high bytes first).- Parameters:
endianType- Endian type.value- Value to be converted.- Returns:
- Converted value.
-