Package ffx.utilities
Class ByteSwap
java.lang.Object
ffx.utilities.ByteSwap
ByteSwap class.
- Since:
- 1.0
- Author:
- Timothy D. Fenn
-
Method Summary
Modifier and TypeMethodDescriptionstatic doubleswap(double value) Byte swap a single double value.static voidswap(double[] array) Byte swap an array of doubles.static floatswap(float value) Byte swap a single float value.static voidswap(float[] array) Byte swap an array of floats.static intswap(int value) Byte swap a single int value.static voidswap(int[] array) Byte swap an array of ints.static longswap(long value) Byte swap a single long value.static voidswap(long[] array) Byte swap an array of longs.static shortswap(short value) Byte swap a single short value.static voidswap(short[] array) Byte swap an array of shorts.
-
Method Details
-
swap
public static short swap(short value) Byte swap a single short value.- Parameters:
value- Value to byte swap.- Returns:
- Byte swapped representation.
-
swap
public static int swap(int value) Byte swap a single int value.- Parameters:
value- Value to byte swap.- Returns:
- Byte swapped representation.
-
swap
public static long swap(long value) Byte swap a single long value.- Parameters:
value- Value to byte swap.- Returns:
- Byte swapped representation.
-
swap
public static float swap(float value) Byte swap a single float value.- Parameters:
value- Value to byte swap.- Returns:
- Byte swapped representation.
-
swap
public static double swap(double value) Byte swap a single double value.- Parameters:
value- Value to byte swap.- Returns:
- Byte swapped representation.
-
swap
public static void swap(short[] array) Byte swap an array of shorts. The result of the swapping is put back into the specified array.- Parameters:
array- Array of values to swap
-
swap
public static void swap(int[] array) Byte swap an array of ints. The result of the swapping is put back into the specified array.- Parameters:
array- Array of values to swap
-
swap
public static void swap(long[] array) Byte swap an array of longs. The result of the swapping is put back into the specified array.- Parameters:
array- Array of values to swap
-
swap
public static void swap(float[] array) Byte swap an array of floats. The result of the swapping is put back into the specified array.- Parameters:
array- Array of values to swap
-
swap
public static void swap(double[] array) Byte swap an array of doubles. The result of the swapping is put back into the specified array.- Parameters:
array- Array of values to swap
-