void checkExpand(int add) throws IOException {
		int len = offset + add;
		if (buffer.length() < len) {
			buffer.setSize(buffer.length() + increment, true);
		}
	}
An output stream backed by a database chained buffer
Ghidra/Debug/ProposedUtils/src/main/java/ghidra/util/database/DBBufferOutputStream.java