public byte[] readBytes()
    {
        byte[] bytes = slice.getBytes();
        offset = slice.length();
        return bytes;
    }
@Test
    public void testReadBytes()
    {
        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.readBytes();
        assertEquals(actual, expected);
    }