@Override
	public int read() throws IOException {
		return (currentPosition < provider.length())
				? Byte.toUnsignedInt(provider.readByte(currentPosition++))
				: -1;
	}
Creates an InputStream that uses a ByteProvider as its source of bytes.
 
@param provider the {@link ByteProvider} to wrap
@param startPosition starting position in the provider
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/ByteProviderInputStream.java