public static byte[] toBytes(final ByteBuffer byteBuffer, int index, int length) {
        final byte[] arr = new byte[length];
        byteBuffer.get(index, arr, 0, length);
        return arr;
    }
Get the requested length number of bytes from the specified index.
stroom-bytebuffer/src/main/java/stroom/bytebuffer/ByteBufferUtils.java