@Override
		public int read(byte[] b, int off, int len) throws IOException {
			if (off < 0 || off >= b.length) {
				throw new IllegalArgumentException("Array index out of range: " + off);
			}
			long fileBytesLen = length();
			if (offset >= fileBytesLen) {
				return -1;
			}
			long limit = fileBytesLen - offset;
			if (len > limit) {
				len = (int) limit; // reduce read length
			}
			byte[] bytes = new byte[len];
			int count = fileBytes.getOriginalBytes(offset, bytes);
			System.arraycopy(bytes, 0, b, off, count);
			offset += count;
			return count;
		}
Construct byte provider from original file bytes
@param fileBytes original file bytes
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/FileBytesProvider.java