}  if (etag == null && lastModified == -1 && redir == null && cache && error == null) try { digest = MessageDigest.getInstance("MD5");   byte[] b = digest.digest(response); etag = "\""+new String (Base64.encode(b))+"\""; if (reqtrans != null && reqtrans.hasETag (etag)) { response = new byte[0]; notModified = true; } } catch (Exception ignore) {
    public synchronized void close (String cset) throws UnsupportedEncodingException {	// only use default charset if not explicitly set for this response.	if (charset == null)	    charset = cset;	// if charset is not set, use western encoding	if (charset == null)	    charset = "ISO-8859-1";	boolean encodingError = false;	if (response == null) {	    if (buffer != null) {	        if (debugBuffer != null)	            buffer.append (debugBuffer);	        try {	            response = buffer.toString ().getBytes (charset);	        } catch (UnsupportedEncodingException uee) {	            encodingError = true;	            response = buffer.toString ().getBytes ();	        }	        // if etag is not set, calc MD5 digest and check it	        if (etag == null && lastModified == -1 &&	            redir == null && error == null) try {	            digest = MessageDigest.getInstance("MD5");	            byte[] b = digest.digest(response);	            etag = "\""+new String (Base64.encode(b))+"\"";	            if (reqtrans != null && reqtrans.hasETag (etag)) {	                response = new byte[0];	                notModified = true;	            }	        } catch (Exception ignore) {	            // Etag creation failed for some reason. Ignore.	        }	        buffer = null; // make sure this is done only once, even with more requsts attached	    } else {	        response = new byte[0];	    }	}	notifyAll ();	// if there was a problem with the encoding, let the app know	if (encodingError)	    throw new UnsupportedEncodingException (charset);    }