code: public int fillWindow(ByteBuffer buffer) {
          assert !finishing;
  
          // Move the sliding window if needed.
          if (readPos >= bufSize - keepSizeAfter)
              moveWindow();
  
          // Try to fill the dictionary buffer. If it becomes full,
          // some of the input bytes may be left unused.
          int len = buffer.remaining();
          if (len > bufSize - writePos)
              len = bufSize - writePos;
  
          buffer.get(buf, writePos, len);
          writePos += len;
  
          // Set the new readLimit but only if there's enough data to allow
          // encoding of at least one more byte.
          if (writePos >= keepSizeAfter)
              readLimit = writePos - keepSizeAfter;
  
          processPendingBytes();
  
          // Tell the caller how much input we actually copied into
          // the dictionary.
          return len;
      }
docs: Copies new data into the LZEncoder's buffer.