Class ArrayConversionHelper
- java.lang.Object
-
- org.datanucleus.store.types.converters.ArrayConversionHelper
-
public class ArrayConversionHelper extends java.lang.Object
Helper class providing conversion methods for use with arrays.
-
-
Field Summary
Fields Modifier and Type Field Description private static int
NR_BIGINTEGER_BYTES
private static int
NR_SCALE_BYTES
private static int
NR_SIGNAL_BYTES
private static int
TOTAL_BYTES
-
Constructor Summary
Constructors Constructor Description ArrayConversionHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.math.BigDecimal[]
getBigDecimalArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.static java.math.BigInteger[]
getBigIntegerArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.static java.util.BitSet
getBitSetFromBooleanArray(boolean[] buf)
Convert a boolean[] into an instance of our value class.static boolean[]
getBooleanArrayFromBitSet(java.util.BitSet value)
Convert an instance of our value class into a boolean[].static boolean[]
getBooleanArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.static java.lang.Boolean[]
getBooleanObjectArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.static byte[]
getByteArrayFromBigDecimalArray(java.math.BigDecimal[] value)
Convert an instance of our value class into a byte[].static byte[]
getByteArrayFromBigIntegerArray(java.math.BigInteger[] value)
Convert an instance of our value class into a byte[].static byte[]
getByteArrayFromBooleanArray(boolean[] value)
Convert an instance of our value class into a byte[].static byte[]
getByteArrayFromBooleanObjectArray(java.lang.Boolean[] value)
Convert an instance of our value class into a byte[].static byte[]
getByteArrayFromByteObjectArray(java.lang.Byte[] value)
Convert an instance of our value class into a byte[].static byte[]
getByteArrayFromCharArray(char[] value)
Convert an instance of our value class into a byte[].static byte[]
getByteArrayFromCharObjectArray(java.lang.Character[] value)
Convert an instance of our value class into a byte[].static byte[]
getByteArrayFromDoubleArray(double[] value)
Convert an instance of our value class into a byte[].static byte[]
getByteArrayFromDoubleObjectArray(java.lang.Double[] value)
Convert an instance of our value class into a byte[].static byte[]
getByteArrayFromFloatArray(float[] value)
Convert an instance of our value class into a byte[].static byte[]
getByteArrayFromFloatObjectArray(java.lang.Float[] value)
Convert an instance of our value class into a byte[].static byte[]
getByteArrayFromIntArray(int[] value)
Convert an instance of our value class into a byte[].static byte[]
getByteArrayFromIntObjectArray(java.lang.Integer[] value)
Convert an instance of our value class into a byte[].static byte[]
getByteArrayFromLongArray(long[] value)
Convert an instance of our value class into a byte[].static byte[]
getByteArrayFromLongObjectArray(java.lang.Long[] value)
Convert an instance of our value class into a byte[].static byte[]
getByteArrayFromShortArray(short[] value)
Convert an instance of our value class into a byte[].static byte[]
getByteArrayFromShortObjectArray(java.lang.Short[] value)
Convert an instance of our value class into a byte[].static java.lang.Byte[]
getByteObjectArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.static char[]
getCharArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.static java.lang.Character[]
getCharObjectArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.static double[]
getDoubleArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.static java.lang.Double[]
getDoubleObjectArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.static float[]
getFloatArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.static java.lang.Float[]
getFloatObjectArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.static int[]
getIntArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.static java.lang.Integer[]
getIntObjectArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.static long[]
getLongArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.static java.lang.Long[]
getLongObjectArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.static short[]
getShortArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.static java.lang.Short[]
getShortObjectArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.
-
-
-
Method Detail
-
getBooleanArrayFromBitSet
public static boolean[] getBooleanArrayFromBitSet(java.util.BitSet value)
Convert an instance of our value class into a boolean[].- Parameters:
value
- Object to be converted- Returns:
- converted boolean array
-
getBitSetFromBooleanArray
public static java.util.BitSet getBitSetFromBooleanArray(boolean[] buf)
Convert a boolean[] into an instance of our value class.- Parameters:
buf
- boolean array to be converted- Returns:
- converted boolean array as BitSet
-
getBooleanArrayFromByteArray
public static boolean[] getBooleanArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted boolean array as object
-
getByteArrayFromBooleanArray
public static byte[] getByteArrayFromBooleanArray(boolean[] value)
Convert an instance of our value class into a byte[].- Parameters:
value
- Object to be converted- Returns:
- converted byte array
-
getCharArrayFromByteArray
public static char[] getCharArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted char array as object
-
getByteArrayFromCharArray
public static byte[] getByteArrayFromCharArray(char[] value)
Convert an instance of our value class into a byte[].- Parameters:
value
- Object to be converted- Returns:
- converted byte array
-
getDoubleArrayFromByteArray
public static double[] getDoubleArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted double array as object
-
getByteArrayFromDoubleArray
public static byte[] getByteArrayFromDoubleArray(double[] value)
Convert an instance of our value class into a byte[].- Parameters:
value
- Object to be converted- Returns:
- converted byte array
-
getFloatArrayFromByteArray
public static float[] getFloatArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted float array as object
-
getByteArrayFromFloatArray
public static byte[] getByteArrayFromFloatArray(float[] value)
Convert an instance of our value class into a byte[].- Parameters:
value
- Object to be converted- Returns:
- converted byte array
-
getIntArrayFromByteArray
public static int[] getIntArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted int array as object
-
getByteArrayFromIntArray
public static byte[] getByteArrayFromIntArray(int[] value)
Convert an instance of our value class into a byte[].- Parameters:
value
- Object to be converted- Returns:
- converted byte array
-
getLongArrayFromByteArray
public static long[] getLongArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted long array as object
-
getByteArrayFromLongArray
public static byte[] getByteArrayFromLongArray(long[] value)
Convert an instance of our value class into a byte[].- Parameters:
value
- Object to be converted- Returns:
- converted byte array
-
getShortArrayFromByteArray
public static short[] getShortArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted short array as object
-
getByteArrayFromShortArray
public static byte[] getByteArrayFromShortArray(short[] value)
Convert an instance of our value class into a byte[].- Parameters:
value
- Object to be converted- Returns:
- converted byte array
-
getByteArrayFromBigDecimalArray
public static byte[] getByteArrayFromBigDecimalArray(java.math.BigDecimal[] value)
Convert an instance of our value class into a byte[].- Parameters:
value
- Object to be converted- Returns:
- converted byte array
-
getBigDecimalArrayFromByteArray
public static java.math.BigDecimal[] getBigDecimalArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted BigDecimal array as object
-
getByteArrayFromBigIntegerArray
public static byte[] getByteArrayFromBigIntegerArray(java.math.BigInteger[] value)
Convert an instance of our value class into a byte[].- Parameters:
value
- Object to be converted- Returns:
- converted byte array
-
getBigIntegerArrayFromByteArray
public static java.math.BigInteger[] getBigIntegerArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted short array as object
-
getByteArrayFromBooleanObjectArray
public static byte[] getByteArrayFromBooleanObjectArray(java.lang.Boolean[] value)
Convert an instance of our value class into a byte[].- Parameters:
value
- Boolean[] to be converted- Returns:
- converted byte array
-
getBooleanObjectArrayFromByteArray
public static java.lang.Boolean[] getBooleanObjectArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted Boolean array as object
-
getByteArrayFromByteObjectArray
public static byte[] getByteArrayFromByteObjectArray(java.lang.Byte[] value)
Convert an instance of our value class into a byte[].- Parameters:
value
- Byte[] to be converted- Returns:
- converted byte array
-
getByteObjectArrayFromByteArray
public static java.lang.Byte[] getByteObjectArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted Byte array as object
-
getByteArrayFromCharObjectArray
public static byte[] getByteArrayFromCharObjectArray(java.lang.Character[] value)
Convert an instance of our value class into a byte[].- Parameters:
value
- Character array to be converted- Returns:
- converted byte array
-
getCharObjectArrayFromByteArray
public static java.lang.Character[] getCharObjectArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted Character array as object
-
getByteArrayFromDoubleObjectArray
public static byte[] getByteArrayFromDoubleObjectArray(java.lang.Double[] value)
Convert an instance of our value class into a byte[].- Parameters:
value
- Double array to be converted- Returns:
- converted byte array
-
getDoubleObjectArrayFromByteArray
public static java.lang.Double[] getDoubleObjectArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted Double array as object
-
getByteArrayFromFloatObjectArray
public static byte[] getByteArrayFromFloatObjectArray(java.lang.Float[] value)
Convert an instance of our value class into a byte[].- Parameters:
value
- Float array to be converted- Returns:
- converted byte array
-
getFloatObjectArrayFromByteArray
public static java.lang.Float[] getFloatObjectArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted Float array as object
-
getByteArrayFromIntObjectArray
public static byte[] getByteArrayFromIntObjectArray(java.lang.Integer[] value)
Convert an instance of our value class into a byte[].- Parameters:
value
- Integer array to be converted- Returns:
- converted byte array
-
getIntObjectArrayFromByteArray
public static java.lang.Integer[] getIntObjectArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted Integer array as object
-
getByteArrayFromLongObjectArray
public static byte[] getByteArrayFromLongObjectArray(java.lang.Long[] value)
Convert an instance of our value class into a byte[].- Parameters:
value
- Long array to be converted- Returns:
- converted byte array
-
getLongObjectArrayFromByteArray
public static java.lang.Long[] getLongObjectArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted Long array as object
-
getByteArrayFromShortObjectArray
public static byte[] getByteArrayFromShortObjectArray(java.lang.Short[] value)
Convert an instance of our value class into a byte[].- Parameters:
value
- Short array to be converted- Returns:
- converted byte array
-
getShortObjectArrayFromByteArray
public static java.lang.Short[] getShortObjectArrayFromByteArray(byte[] buf)
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted Short array as object
-
-