@Override
    @Nullable
    public boolean[] readBooleanArray() throws EOFException {
        int len = readInt();
        if (len == NULL_ARRAY_LENGTH) {
            return null;
        }
        if (len > 0) {
            boolean[] values = new boolean[len];
            for (int i = 0; i < len; i++) {
                values[i] = readBoolean();
            }
            return values;
        }
        return new boolean[0];
    }
@Test
    public void testReadBooleanArray() throws Exception {
        byte[] bytesBE = {0, 0, 0, 0, 0, 0, 0, 1, 1, 9, -1, -1, -1, -1};
        byte[] bytesLE = {0, 0, 0, 0, 1, 0, 0, 0, 1, 9, -1, -1, -1, -1};
        in.init((byteOrder == BIG_ENDIAN ? bytesBE : bytesLE), 0);

        in.position(10);
        boolean[] theNullArray = in.readBooleanArray();
        in.position(0);
        boolean[] theZeroLengthArray = in.readBooleanArray();
        in.position(4);
        boolean[] booleanArray = in.readBooleanArray();

        assertNull(theNullArray);
        assertArrayEquals(new boolean[0], theZeroLengthArray);
        assertArrayEquals(new boolean[]{true}, booleanArray);
    }