@Override
	public byte[] readBytes(long index, long length) throws IOException {
		assertValidIndex(index, true);
		if (index + length > srcBytes.length) {
			throw new IOException("Attempt to read beyond end of byte data");
		}
		byte[] destBytes = new byte[(int) length];
		System.arraycopy(srcBytes, (int) index, destBytes, 0, (int) length);
		return destBytes;
	}
Throws {@link IOException} if index is not a valid position in the buffer

@param index position in buffer to test
@param inclusiveMax allow buffer.length as index
@throws IOException if index is out of bounds
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/ByteArrayProvider.java