public final static byte[] getBytesFromFile(ResourceFile sourceFile, long offset, long length)
			throws IOException {
		if (length > MAX_FILE_SIZE) {
			throw new IOException("File is too large: " + sourceFile.getName() +
				" file must be less than " + MAX_FILE_SIZE + " bytes");
		}
		if (offset < 0 || length < 0) {
			throw new IllegalArgumentException(
				"offset[" + offset + "] and length[" + length + "] must be greater than 0");
		}
		byte[] data = new byte[(int) length];

		try (InputStream fis = sourceFile.getInputStream()) {
			if (fis.skip(offset) != offset) {
				throw new IOException("Did not skip to the specified offset!");
			}
			int n = fis.read(data);
			if (n != length) {
				throw new IOException("Did not read expected number of bytes! Expected " + length +
					", but read " + n);
			}
			return data;
		}
	}
Return an array of bytes read from the sourceFile, starting at the
given offset
@param sourceFile file to read from
@param offset offset into the file to begin reading
@param length size of returned array of bytes
@return array of bytes, size length
@throws IOException thrown if there was a problem accessing the file or if there weren't
at least {@code length} bytes read.
Ghidra/Framework/Utility/src/main/java/utilities/util/FileUtilities.java