@Override
	public synchronized int put(int offset, byte[] data, int dataOffset, int length)
			throws IndexOutOfBoundsException, IOException {

		if (readOnly) {
			throw new UnsupportedOperationException("Read-only buffer");
		}
		if (dataBufferIdTable == null) {
			throw new AssertException("Invalid Buffer");
		}
		if (offset < 0 || (offset + length - 1) >= size) {
			throw new IndexOutOfBoundsException();
		}
		int index = offset / dataSpace;
		int bufferDataOffset = offset % dataSpace;
		int len = length;

		if (useXORMask) {
			xorData = new byte[dataSpace];
		}
		try {
			while (len > 0) {
				int n = putBytes(index++, bufferDataOffset, data, dataOffset, len);
				dataOffset += n;
				len -= n;
				bufferDataOffset = 0;
			}
			return offset + length;
		}
		finally {
			xorData = null;
		}
	}
Fill buffer with data provided by InputStream.  If 
stream is exhausted, the remainder of the buffer will be filled
with 0's.
@param in data source
@throws IOException thrown if IO error occurs.
Ghidra/Framework/DB/src/main/java/db/ChainedBuffer.java