code: @Override
    public synchronized boolean needsInput() {
      // Consume remaining compressed data?
      if (uncompressedDirectBuf.remaining() > 0) {
        return false;
      }
  
      // Check if lz4 has consumed all input
      if (compressedDirectBufLen <= 0) {
        // Check if we have consumed all user-input
        if (userBufLen <= 0) {
          return true;
        } else {
          setInputFromSavedData();
        }
      }
  
      return false;
    }
docs: Returns true if the input data buffer is empty and
  {@link #setInput(byte[], int, int)} should be called to
  provide more input.
  
  @return <code>true</code> if the input data buffer is empty and
  {@link #setInput(byte[], int, int)} should be called in
  order to provide more input.