code: public long contentLengthSent()
    {
      OutHttpApp stream = _responseStream;
      
      // stream can be null for duplex (websocket)
      if (stream != null) {
        return stream.contentLength();
      }
      else {
        return Math.max(_contentLengthOut, 0);
      }
    }
docs: Returns the number of bytes sent to the output.