private int countChunks(int len){
  int result=0;
  if (len == 0)   return result;
  if (readChunk != null) {
    len-=Math.min(readChunk.remaining(),len);
    result++;
  }
  if (len == 0)   return result;
  if (!list.isEmpty()) {
    Iterator<ByteBuffer> i=list.iterator();
    while (len > 0 && i.hasNext()) {
      ByteBuffer src=i.next();
      len-=Math.min(src.remaining(),len);
      result++;
    }
  }
  if (len == 0)   return result;
  if (writeChunk != null) {
    result++;
  }
  return result;
}

private int countChunks ( int len ) { int result = 0 ; if ( len == 0 ) return result ; if ( readChunk != null ) { len -= Math . min ( readChunk . remaining ( ) , len ) ; result ++ ; } if ( len == 0 ) return result ; if ( ! list . isEmpty ( ) ) { Iterator < ByteBuffer > i = list . iterator ( ) ; while ( len > 0 && i . hasNext ( ) ) { ByteBuffer src = i . next ( ) ; len -= Math . min ( src . remaining ( ) , len ) ; result ++ ; } } if ( len == 0 ) return result ; if ( writeChunk != null ) { result ++ ; } return result ; }
count the number of chunks the given amount of bytes is spawn starting from the read pointer .
