public byte [] readBytes(long index, long length) throws IOException {
        randomAccessFile.seek(index);
        byte [] b = new byte[(int)length];
        int nRead = randomAccessFile.read(b);
        if (nRead != length) {
            throw new IOException("Unable to read "+length+" bytes");
        }
        return b;
    }
@see GByteProvider.app.util.bin.ByteProvider#readBytes(long, long)
GPL/DMG/src/dmg/java/mobiledevices/dmg/ghidra/GByteProvider.java