public int substract( byte src[], int off, int len )
throws IOException {
if ((end - start) == 0) {
if (in == null)
return -1;
//重点,进行流读取标识,读到末尾,会返回-1,里边realReadBytes的方法进行了详细的处理
int n = in.realReadBytes( buff, 0, buff.length );
if (n < 0)
return -1;
}
int n = len;
if (len > getLength()) {
n = getLength();
}
//进行流的复制,从socket到应用层
System.arraycopy(buff, start, src, off, n);
start += n;
return n;
}
org.apache.tomcat.util.buf.ByteChunk