private boolean shrinkToSingleBuffer(boolean preserveData) throws IOException {

		int singleDataSpace = bufferMgr.getBufferSize() - DATA_BASE_OFFSET_NONINDEXED;
		if (size > singleDataSpace) {
			return false;
		}

		// Convert first index buffer to a data buffer
		DataBuffer firstBuffer = bufferMgr.getBuffer(firstBufferId);
		DataBuffer oldFirstDataBuf = null;
		try {
			firstBuffer.putByte(NODE_TYPE_OFFSET, NodeMgr.CHAINED_BUFFER_DATA_NODE);
			firstBuffer.putInt(DATA_LENGTH_OFFSET, getObfuscationDataLengthFieldValue());

			if (preserveData && dataBufferIdTable[0] >= 0) {
				oldFirstDataBuf = bufferMgr.getBuffer(dataBufferIdTable[0]);
				firstBuffer.copy(DATA_BASE_OFFSET_NONINDEXED, oldFirstDataBuf,
					DATA_BASE_OFFSET_INDEXED, size);
			}
		}
		finally {
			bufferMgr.releaseBuffer(firstBuffer);
			if (oldFirstDataBuf != null) {
				bufferMgr.releaseBuffer(oldFirstDataBuf);
			}
		}

		// Remove all data buffers
		for (int element : dataBufferIdTable) {
			if (element >= 0) {
				bufferMgr.deleteBuffer(element);
			}
		}

		// Remove all, except the first, index buffers
		for (int i = 1; i < indexBufferIdTable.length; i++) {
			bufferMgr.deleteBuffer(indexBufferIdTable[i]);
		}

		// Update buffer offsets, sizes and elliminate index
		dataBaseOffset = DATA_BASE_OFFSET_NONINDEXED;
		dataSpace = singleDataSpace;
		dataBufferIdTable = new int[1];
		dataBufferIdTable[0] = firstBufferId;
		indexBufferIdTable = null;
		return true;
	}
Attempt to shrink this DBBuffer object into a single data buffer.
The current <code>size</code> field reflects the new small size.
@param preserveData if true, existing data is preserved at the original offsets.  If false,
no additional effort will be expended to preserve data.
@return true if successful, false if too big for single buffer.
@throws IOException thrown if an IO error occurs.
Ghidra/Framework/DB/src/main/java/db/ChainedBuffer.java