common/src/main/java/HTTPClient/RespInputStream.java
/**
     * Reads <var>len</var> bytes into <var>b</var>, starting at offset
     * <var>off</var>.
     *
     * @return the number of bytes actually read, or -1 if EOF.
     * @exception IOException if any exception occured on the connection.
     */
Reads len bytes into b, starting at offset
off.

@return the number of bytes actually read, or -1 if EOF.
@exception IOException if any exception occured on the connection.
Reads len bytes into b starting at offset off . @return the number of bytes actually read or - 1 if EOF . @exception IOException if any exception occured on the connection .
public synchronized int read(byte[] b, int off, int len) throws IOException
    {
	if (closed)
	    return -1;
	int left = end - offset;
	if (buffer != null  &&  !(left == 0  &&  interrupted))
	{
	    if (left == 0)  return -1;
	    len = (len > left ? left : len);
	    System.arraycopy(buffer, offset, b, off, len);
	    offset += len;
	    return len;
	}
	else
	{
	    if (resph.resp.cd_type != CD_HDRS)
		Log.write(Log.DEMUX, "RspIS: Reading stream " + this.hashCode());
	    int rcvd;
	    if (dontTimeoutBody  &&  resph.resp.cd_type != CD_HDRS)
		rcvd = demux.read(b, off, len, resph, 0);
	    else
		rcvd = demux.read(b, off, len, resph, resph.resp.timeout);
	    if (rcvd != -1  &&  resph.resp.got_headers)
		count += rcvd;
	    return rcvd;
	}
    }
public synchronized int read ( byte [ ] b , int off , int len ) throws IOException { if ( closed ) return - 1 ; int left = end - offset ; if ( buffer != null && ! ( left == 0 && interrupted ) ) { if ( left == 0 ) return - 1 ; len = ( len > left ? left : len ) ; System . arraycopy ( buffer , offset , b , off , len ) ; offset += len ; return len ; } else { if ( resph . resp . cd_type != CD_HDRS ) Log . write ( Log . DEMUX , "RspIS: Reading stream " + this . hashCode ( ) ) ; int rcvd ; if ( dontTimeoutBody && resph . resp . cd_type != CD_HDRS ) rcvd = demux . read ( b , off , len , resph , 0 ) ; else rcvd = demux . read ( b , off , len , resph , resph . resp . timeout ) ; if ( rcvd != - 1 && resph . resp . got_headers ) count += rcvd ; return rcvd ; } }
Reads <var>len</var> bytes into <var>b</var>, starting at offset
 <var>off</var>.
Reads <var > len< / var > bytes into <var > b< / var > starting at offset <var > off< / var > .