code: private void readChunk()
  	throws IOException {
  
  	String line = readLine(_in).trim();
  	int length  = Integer.parseInt(line, 16);
  
  	if (length > 0) {
  
  	    // make sure the chunk will fit into the buffer
  
  	    if (length > _buf.length) {
  		_buf = new byte[length];
  	    }
  
  	    int bytesLeft = length;
  	    int reqBytes = 0;
  	    int off = 0;
  	    int read = 0;
  
  	    /*  multiple reads might be necessary to load
  		the entire chunk */
  	    while (bytesLeft != 0) {
  		reqBytes = bytesLeft;
  		read = _in.read(_buf, off, reqBytes);
  		if (read == -1) break;
  		bytesLeft -= read;
  		off += read;
  	    }
  
  	    _max = off;
  	    _index = 0;
  
  	} else {
  	    // end of data indicated
  	    _eof = true;
  	}
  
  	_in.read(); // skip CR
  	_in.read(); // skip LF
  
      }
docs: /* only called when the buffer is empty