@Override
	public void close() throws IOException {
		buffer.setSize(offset, true);
	}
An output stream backed by a database chained buffer
Ghidra/Debug/ProposedUtils/src/main/java/ghidra/util/database/DBBufferOutputStream.java