public synchronized void setSize(int size, boolean preserveData) throws IOException {
		if (readOnly) {
			throw new UnsupportedOperationException("Read-only buffer");
		}
		if (uninitializedDataSource != null) {
			throw new UnsupportedOperationException(
				"Buffer size may not be changed when using unintialized data source");
		}
		if (dataBufferIdTable == null) {
			throw new AssertException("Invalid Buffer");
		}
		if (size > this.size) {
			grow(size, preserveData);
		}
		else {
			shrink(size, preserveData);
		}
	}
Set the new size for this DBBuffer object.
@param size new size
@param preserveData if true, existing data is preserved at the original offsets.  If false,
no additional effort will be expended to preserve data.
@throws UnsupportedOperationException thrown if this ChainedBuffer utilizes an 
Uninitialized Data Source or is read-only
@throws IOException thrown if an IO error occurs.
Ghidra/Framework/DB/src/main/java/db/ChainedBuffer.java