Here you can find the source of fromBytes(byte[] data, boolean[] preAllocatedValues)
protected static void fromBytes(byte[] data, boolean[] preAllocatedValues)
//package com.java2s; //License from project: Open Source License import java.nio.ByteBuffer; public class Main { protected static void fromBytes(byte[] data, int[] preAllocatedValues) { final ByteBuffer byteBuffer = ByteBuffer.wrap(data); for (int i = 0; i < preAllocatedValues.length; i++) { preAllocatedValues[i] = byteBuffer.getInt(); }/* w w w .j a v a2 s .c o m*/ } protected static void fromBytes(byte[] data, long[] preAllocatedValues) { final ByteBuffer byteBuffer = ByteBuffer.wrap(data); for (int i = 0; i < preAllocatedValues.length; i++) { preAllocatedValues[i] = byteBuffer.getLong(); } } protected static void fromBytes(byte[] data, short[] preAllocatedValues) { final ByteBuffer byteBuffer = ByteBuffer.wrap(data); for (int i = 0; i < preAllocatedValues.length; i++) { preAllocatedValues[i] = byteBuffer.getShort(); } } protected static void fromBytes(byte[] data, char[] preAllocatedValues) { final ByteBuffer byteBuffer = ByteBuffer.wrap(data); for (int i = 0; i < preAllocatedValues.length; i++) { preAllocatedValues[i] = byteBuffer.getChar(); } } protected static void fromBytes(byte[] data, boolean[] preAllocatedValues) { final ByteBuffer byteBuffer = ByteBuffer.wrap(data); for (int i = 0; i < preAllocatedValues.length; i++) { preAllocatedValues[i] = byteBuffer.get() == 1; } } protected static void fromBytes(byte[] data, byte[] preAllocatedValues) { final ByteBuffer byteBuffer = ByteBuffer.wrap(data); for (int i = 0; i < preAllocatedValues.length; i++) { preAllocatedValues[i] = byteBuffer.get(); } } protected static void fromBytes(byte[] data, double[] preAllocatedValues) { final ByteBuffer byteBuffer = ByteBuffer.wrap(data); for (int i = 0; i < preAllocatedValues.length; i++) { preAllocatedValues[i] = byteBuffer.getDouble(); } } public static void fromBytes(byte[] data, float[] preAllocatedValues) { final ByteBuffer byteBuffer = ByteBuffer.wrap(data); for (int i = 0; i < preAllocatedValues.length; i++) { preAllocatedValues[i] = byteBuffer.getFloat(); } } }