private int putBytes(int index, int bufferDataOffset, byte[] data, int dataOffset, int length)
			throws IOException {
		int availableSpace = dataSpace - bufferDataOffset;
		int len = availableSpace < length ? availableSpace : length;
		if (xorData != null) {
			int offset = bufferDataOffset;
			int dataIndex = dataOffset;
			for (int i = 0; i < len; i++, dataIndex++, offset++) {
				xorData[i] = xorMaskByte(offset, data[dataIndex]);
			}
			data = xorData;
			dataOffset = 0;
		}
		DataBuffer buffer = getBuffer(index);
		buffer.put(bufferDataOffset + dataBaseOffset, data, dataOffset, len);
		bufferMgr.releaseBuffer(buffer);
		return len;
	}
Put data into the specified chained buffer.  
NOTE: The caller of this method is responsible for allocating the xorData byte array
used for applying the obfuscation XOR mask.
@param index index of within buffer chain
@param bufferDataOffset data buffer offset
@param data source byte array
@param dataOffset source array offset within data
@param length number of bytes to write
@return int actual number of bytes written.  
This could be smaller than length if the end of buffer is 
encountered while writing data.
@throws IOException thrown if an IO error occurs
Ghidra/Framework/DB/src/main/java/db/ChainedBuffer.java