public byte[] getByteArray()
    {
        return slice.byteArray();
    }
@Test
    public void testGetByteArray()
    {
        int numElements = 100;
        Slice slice = Slices.allocate(2 * numElements);
        byte[] expected = new byte[2 * numElements];

        int offset = 0;
        for (int i = 0; i < numElements; i++) {
            String str = "" + i;
            slice.setBytes(offset, str.getBytes());
            int length = str.getBytes().length;
            System.arraycopy(str.getBytes(), 0, expected, offset, length);
            offset += length;
        }

        SimpleSliceInputStream simpleSliceInputStream = new SimpleSliceInputStream(slice);
        byte[] actual = simpleSliceInputStream.getByteArray();
        assertEquals(actual, expected);
    }