public int read(byte []read_buffer, int offset, int length) throws IOException {
       // Copy as much as possible from the read buffer 
       if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
           logger.logp(Level.FINE, CLASS_NAME,"read", "read length -->"+length);
       } 
       
       if ( total >= limit )
       {
           if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
               logger.logp(Level.FINE, CLASS_NAME,"read", "Over the limit: -1");
           } 
           return -1;
       }
       
       int buf_len = count - pos;
       if (buf_len > 0) {
          if (buf_len >= length) {
             // Copy part of read buffer
             System.arraycopy(buf,pos,read_buffer,offset,length);
             pos += length;

             // begin 280584.2    java.io.IOException: SRVE0080E: Invalid content length    WAS.webcontainer    
             this.total += length;
             // end 280584.2    java.io.IOException: SRVE0080E: Invalid content length    WAS.webcontainer

             if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
                 logger.logp(Level.FINE, CLASS_NAME,"read", "read returning -->"+length);
             }
             return length;
          }
          // Copy all read buffer
          System.arraycopy(buf,pos,read_buffer,offset,buf_len);
          count = pos = 0;  // reset buffer
          offset += buf_len;
          length -= buf_len;
       }
       // Try to read remainder directly from the input stream into
       // the caller's buffer, avoiding an extra copy
       int bytes_read = buf_len;
	   int rtn = 0;
	   if(length>0)
	   {
			rtn = in.read(read_buffer,offset,length);
	   }
	   if (rtn > 0) {
		  bytes_read += rtn;
	   }
       // begin 280584.2    java.io.IOException: SRVE0080E: Invalid content length    WAS.webcontainer    
       this.total += bytes_read;
       // end 280584.2    java.io.IOException: SRVE0080E: Invalid content length    WAS.webcontainer    


       if (bytes_read == 0) {
           bytes_read = -1;
       }
       
       if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
       		logger.logp(Level.FINE, CLASS_NAME,"read", "read returning -->"+bytes_read+", total="+total+",limit="+limit);
       }
       return bytes_read;
    }
public int read ( byte [ ] read_buffer , int offset , int length ) throws IOException { if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "read" , "read length -->" + length ) ; } if ( total >= limit ) { if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "read" , "Over the limit: -1" ) ; } return - 1 ; } int buf_len = count - pos ; if ( buf_len > 0 ) { if ( buf_len >= length ) { System . arraycopy ( buf , pos , read_buffer , offset , length ) ; pos += length ; this . total += length ; if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "read" , "read returning -->" + length ) ; } return length ; } System . arraycopy ( buf , pos , read_buffer , offset , buf_len ) ; count = pos = 0 ; offset += buf_len ; length -= buf_len ; } int bytes_read = buf_len ; int rtn = 0 ; if ( length > 0 ) { rtn = in . read ( read_buffer , offset , length ) ; } if ( rtn > 0 ) { bytes_read += rtn ; } this . total += bytes_read ; if ( bytes_read == 0 ) { bytes_read = - 1 ; } if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "read" , "read returning -->" + bytes_read + ", total=" + total + ",limit=" + limit ) ; } return bytes_read ; }
Reads into an array of bytes. This method will block until some input
is available.
@param b the buffer into which the data is read
@param off the start offset of the data
@param len the maximum number of bytes read
@return the actual number of bytes read, or -1 if the end of the
stream is reached
@exception IOException if an I/O error has occurred