@Override
	public int read(byte[] b, int off, int len) throws IOException {
		if (position >= limit) {
			return -1;
		}
		int bytesLeft = (int) Math.min(limit - position, Integer.MAX_VALUE);
		int bytesToRead = Math.min(len, bytesLeft);
		int bytesRead = wrappedInputStream.read(b, off, bytesToRead);
		if (bytesRead >= 0) {
			position += bytesRead;
		}
		return bytesRead;
	}
Creates a new instance.

@param wrappedInputStream {@link InputStream} to wrap, already positioned to the desired
starting position.
@param size number of bytes to allow this wrapper to read.
Ghidra/Framework/Utility/src/main/java/ghidra/util/BoundedInputStream.java