Class ArrayConversionHelper
java.lang.Object
org.datanucleus.store.types.converters.ArrayConversionHelper
Helper class providing conversion methods for use with arrays.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static int
private static int
private static int
private static int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BigDecimal[]
getBigDecimalArrayFromByteArray
(byte[] buf) Convert a byte[] into an instance of our value class.static BigInteger[]
getBigIntegerArrayFromByteArray
(byte[] buf) Convert a byte[] into an instance of our value class.static BitSet
getBitSetFromBooleanArray
(boolean[] buf) Convert a boolean[] into an instance of our value class.static boolean[]
getBooleanArrayFromBitSet
(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 Boolean[]
getBooleanObjectArrayFromByteArray
(byte[] buf) Convert a byte[] into an instance of our value class.static byte[]
Convert an instance of our value class into a byte[].static byte[]
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[]
Convert an instance of our value class into a byte[].static byte[]
getByteArrayFromByteObjectArray
(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
(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
(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
(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
(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
(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
(Short[] value) Convert an instance of our value class into a byte[].static 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 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 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 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 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 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 Short[]
getShortObjectArrayFromByteArray
(byte[] buf) Convert a byte[] into an instance of our value class.
-
Field Details
-
NR_BIGINTEGER_BYTES
private static int NR_BIGINTEGER_BYTES -
NR_SCALE_BYTES
private static int NR_SCALE_BYTES -
NR_SIGNAL_BYTES
private static int NR_SIGNAL_BYTES -
TOTAL_BYTES
private static int TOTAL_BYTES
-
-
Constructor Details
-
ArrayConversionHelper
public ArrayConversionHelper()
-
-
Method Details
-
getBooleanArrayFromBitSet
Convert an instance of our value class into a boolean[].- Parameters:
value
- Object to be converted- Returns:
- converted boolean array
-
getBitSetFromBooleanArray
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
Convert an instance of our value class into a byte[].- Parameters:
value
- Object to be converted- Returns:
- converted byte array
-
getBigDecimalArrayFromByteArray
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted BigDecimal array as object
-
getByteArrayFromBigIntegerArray
Convert an instance of our value class into a byte[].- Parameters:
value
- Object to be converted- Returns:
- converted byte array
-
getBigIntegerArrayFromByteArray
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted short array as object
-
getByteArrayFromBooleanObjectArray
Convert an instance of our value class into a byte[].- Parameters:
value
- Boolean[] to be converted- Returns:
- converted byte array
-
getBooleanObjectArrayFromByteArray
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted Boolean array as object
-
getByteArrayFromByteObjectArray
Convert an instance of our value class into a byte[].- Parameters:
value
- Byte[] to be converted- Returns:
- converted byte array
-
getByteObjectArrayFromByteArray
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted Byte array as object
-
getByteArrayFromCharObjectArray
Convert an instance of our value class into a byte[].- Parameters:
value
- Character array to be converted- Returns:
- converted byte array
-
getCharObjectArrayFromByteArray
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted Character array as object
-
getByteArrayFromDoubleObjectArray
Convert an instance of our value class into a byte[].- Parameters:
value
- Double array to be converted- Returns:
- converted byte array
-
getDoubleObjectArrayFromByteArray
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted Double array as object
-
getByteArrayFromFloatObjectArray
Convert an instance of our value class into a byte[].- Parameters:
value
- Float array to be converted- Returns:
- converted byte array
-
getFloatObjectArrayFromByteArray
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted Float array as object
-
getByteArrayFromIntObjectArray
Convert an instance of our value class into a byte[].- Parameters:
value
- Integer array to be converted- Returns:
- converted byte array
-
getIntObjectArrayFromByteArray
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted Integer array as object
-
getByteArrayFromLongObjectArray
Convert an instance of our value class into a byte[].- Parameters:
value
- Long array to be converted- Returns:
- converted byte array
-
getLongObjectArrayFromByteArray
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted Long array as object
-
getByteArrayFromShortObjectArray
Convert an instance of our value class into a byte[].- Parameters:
value
- Short array to be converted- Returns:
- converted byte array
-
getShortObjectArrayFromByteArray
Convert a byte[] into an instance of our value class.- Parameters:
buf
- byte array to be converted- Returns:
- converted Short array as object
-