@Override
	public int available() throws IOException {
		return buffer.length() - offset;
	}
An input stream backed by a database chained buffer
Ghidra/Debug/ProposedUtils/src/main/java/ghidra/util/database/DBBufferInputStream.java