@Override
    @Nullable
    public float[] readFloatArray() throws EOFException {
        int len = readInt();
        if (len == NULL_ARRAY_LENGTH) {
            return null;
        }
        if (len > 0) {
            float[] values = new float[len];
            int sizeInBytes = len * FLOAT_SIZE_IN_BYTES;
            checkAvailable(pos, sizeInBytes);
            ByteBuffer.wrap(data, pos, sizeInBytes).order(getByteOrder()).asFloatBuffer().get(values);
            pos += sizeInBytes;
            return values;
        }
        return new float[0];
    }
@Test
    public void testReadFloatArray() throws Exception {
        byte[] bytesBE = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, -1, -1, -1, -1};
        byte[] bytesLE = {0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, -1, -1, -1, -1};
        in.init((byteOrder == BIG_ENDIAN ? bytesBE : bytesLE), 0);

        in.position(bytesLE.length - 4);
        float[] theNullArray = in.readFloatArray();
        in.position(0);
        float[] theZeroLengthArray = in.readFloatArray();
        in.position(4);
        float[] floats = in.readFloatArray();

        assertNull(theNullArray);
        assertArrayEquals(new float[0], theZeroLengthArray, 0);
        assertArrayEquals(new float[]{Float.intBitsToFloat(1)}, floats, 0);
    }