@Override
	public int read() throws IOException {
		if (offset == buffer.length()) {
			return -1;
		}
		return 0xff & buffer.getByte(offset++);

	}
An input stream backed by a database chained buffer
Ghidra/Debug/ProposedUtils/src/main/java/ghidra/util/database/DBBufferInputStream.java