Package ubic.gemma.persistence.util
Class ByteArrayUtils
- java.lang.Object
-
- ubic.gemma.persistence.util.ByteArrayUtils
-
public class ByteArrayUtils extends Object
Utilities for working with byte arrays.- Author:
- poirigui
- See Also:
ByteArrayConverter
-
-
Constructor Summary
Constructors Constructor Description ByteArrayUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
booleanArrayToBytes(boolean[] data)
static boolean[]
byteArrayToBooleans(byte[] bytes)
static char[]
byteArrayToChars(byte[] barray)
static double[]
byteArrayToDoubles(byte[] bytes)
static float[]
byteArrayToFloats(byte[] bytes)
static int[]
byteArrayToInts(byte[] bytes)
static long[]
byteArrayToLongs(byte[] bytes)
static <T> T[]
byteArrayToObjects(byte[] bytes, Class<T> type)
static String[]
byteArrayToStrings(byte[] bytes)
static String[]
byteArrayToStrings(byte[] bytes, Charset charset)
static String[]
byteArrayToTabbedStrings(byte[] bytes)
static String[]
byteArrayToTabbedStrings(byte[] bytes, Charset charset)
static double[][]
bytesToDoubleMatrix(byte[] bytes, int n)
static byte[]
charArrayToBytes(char[] data)
static byte[]
doubleArrayToBytes(double[] data)
static byte[]
doubleMatrixToBytes(double[][] matrix)
static byte[]
floatArrayToBytes(float[] data)
static byte[]
intArrayToBytes(int[] data)
static byte[]
longArrayToBytes(long[] data)
static <T> byte[]
objectArrayToBytes(T[] objects)
static byte[]
stringsToByteArray(String[] data)
static byte[]
stringsToByteArray(String[] data, Charset charset)
static byte[]
stringsToTabbedBytes(String[] data)
static byte[]
stringsToTabbedBytes(String[] data, Charset charset)
-
-
-
Method Detail
-
floatArrayToBytes
public static byte[] floatArrayToBytes(float[] data)
-
byteArrayToFloats
public static float[] byteArrayToFloats(byte[] bytes)
-
doubleArrayToBytes
public static byte[] doubleArrayToBytes(double[] data)
-
byteArrayToDoubles
public static double[] byteArrayToDoubles(byte[] bytes)
-
intArrayToBytes
public static byte[] intArrayToBytes(int[] data)
-
byteArrayToInts
public static int[] byteArrayToInts(byte[] bytes)
-
longArrayToBytes
public static byte[] longArrayToBytes(long[] data)
-
byteArrayToLongs
public static long[] byteArrayToLongs(byte[] bytes)
-
byteArrayToChars
public static char[] byteArrayToChars(byte[] barray)
-
charArrayToBytes
public static byte[] charArrayToBytes(char[] data)
-
byteArrayToStrings
public static String[] byteArrayToStrings(byte[] bytes)
-
stringsToByteArray
public static byte[] stringsToByteArray(String[] data)
-
stringsToTabbedBytes
public static byte[] stringsToTabbedBytes(String[] data)
-
byteArrayToTabbedStrings
public static String[] byteArrayToTabbedStrings(byte[] bytes)
-
byteArrayToTabbedStrings
public static String[] byteArrayToTabbedStrings(byte[] bytes, Charset charset)
-
byteArrayToBooleans
public static boolean[] byteArrayToBooleans(byte[] bytes)
-
booleanArrayToBytes
public static byte[] booleanArrayToBytes(boolean[] data)
-
doubleMatrixToBytes
public static byte[] doubleMatrixToBytes(double[][] matrix)
-
bytesToDoubleMatrix
public static double[][] bytesToDoubleMatrix(byte[] bytes, int n)
-
objectArrayToBytes
public static <T> byte[] objectArrayToBytes(T[] objects)
-
byteArrayToObjects
public static <T> T[] byteArrayToObjects(byte[] bytes, Class<T> type)
-
-