protected Response(IStatus status,String mimeType,InputStream data,long totalBytes){
  this.status=status;
  this.mimeType=mimeType;
  if (data == null) {
    this.data=new ByteArrayInputStream(new byte[0]);
    this.contentLength=0L;
  }
 else {
    this.data=data;
    this.contentLength=totalBytes;
  }
  this.chunkedTransfer=this.contentLength < 0;
  keepAlive=true;
}

protected Response ( IStatus status , String mimeType , InputStream data , long totalBytes ) { this . status = status ; this . mimeType = mimeType ; if ( data == null ) { this . data = new ByteArrayInputStream ( new byte [ 0 ] ) ; this . contentLength = 0L ; } else { this . data = data ; this . contentLength = totalBytes ; } this . chunkedTransfer = this . contentLength < 0 ; keepAlive = true ; }
creates a fixed length response if totalbytes is not smaller than 0 , otherwise chunked .
