docs: private void writeToBuffers(byte[] value, int start, int len) throws IOException {
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
              Tr.debug(tc, "writeToBuffers, Writing " + len + ", buffered=" + this.bufferedCount);
          }
          if (value.length < (start + len)) {
              throw new IllegalArgumentException("Length outside value range");
          }
          //this.writing = true;
          int remaining = len;
          int offset = start;
          while (0 < remaining) {   
              // if async write required
              if ((_callback != null) && (!this.isInternalReady())){
                  // remaining is yet to write. 
                  //save of the data and amount to write                
                  _remValue = new byte[remaining];
  
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                      Tr.debug(tc, "writeToBuffers, Save of bytesRemainingWhenAsync -->" + _bytesRemainingWhenAsync 
                               + ", value size -->" + value.length + ", remValue size -->" + _remValue.length);
                  }
                  synchronized (this._lockObj) {
   
                      System.arraycopy(value, offset, _remValue, 0, remaining);
                      setDataSaved(true);
  
                      this._lockObj.notifyAll();
                  }
                  break;
              }
              WsByteBuffer buffer = getBuffer();
              int avail = buffer.remaining();
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                  Tr.debug(tc, "writeToBuffers: avail -->"+  avail + " ,bytesRemaining --> " + remaining);
              }
              if (avail >= remaining) {
                  // write all remaining data
                  this.bufferedCount += remaining;
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                      Tr.debug(tc, "writeToBuffers: remaining --> " + remaining);
                  }
                  buffer.put(value, offset, remaining);
                  remaining = 0;
              } else {
                  // write what we can
                  this.bufferedCount += avail;
                  buffer.put(value, offset, avail);
                  offset += avail;
                  remaining -= avail;
              }
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                  Tr.debug(tc, "Writing " + len + ", buffered=" + this.bufferedCount + ", this.amountToBuffer=" + this.amountToBuffer +", remaining=" + remaining);
                  Tr.debug(tc, "writeToBuffers: buffer now -->" + buffer);
              }
              if (this.bufferedCount >= this.amountToBuffer) {
                  if (_callback == null) {
                      flushUpgradedOutputBuffers();
                  }
                  else{
                      _bytesRemainingWhenAsync = remaining;
                      flushAsyncUpgradedOutputBuffers();    
                  }
              }
          }
      }