@Override
	public void write(int b) throws IOException {
		checkExpand(1);
		buffer.putByte(offset, (byte) b);
		offset++;
	}
An output stream backed by a database chained buffer
Ghidra/Debug/ProposedUtils/src/main/java/ghidra/util/database/DBBufferOutputStream.java