common/src/main/java/HTTPClient/HttpURLConnection.java
/**
     * Cache the list of headers.
     */
Cache the list of headers.
Cache the list of headers .
private void fill_hdr_arrays()
    {
	try
	{
	    if (!connected)  connect();
	    int num = 1;
	    Enumeration enumera = resp.listHeaders();
	    while (enumera.hasMoreElements())
	    {
		num++;
		enumera.nextElement();
	    }
	    hdr_keys   = new String[num];
	    hdr_values = new String[num];
	    enumera = resp.listHeaders();
	    for (int idx=1; idx<num; idx++)
	    {
		hdr_keys[idx]   = (String) enumera.nextElement();
		hdr_values[idx] = resp.getHeader(hdr_keys[idx]);
	    }
	    hdr_values[0] = resp.getVersion() + " " + resp.getStatusCode() +
			    " " + resp.getReasonLine();
	}
	catch (Exception e)
	    { hdr_keys = hdr_values = new String[0]; }
    }
private void fill_hdr_arrays ( ) { try { if ( ! connected ) connect ( ) ; int num = 1 ; Enumeration enumera = resp . listHeaders ( ) ; while ( enumera . hasMoreElements ( ) ) { num ++ ; enumera . nextElement ( ) ; } hdr_keys = new String [ num ] ; hdr_values = new String [ num ] ; enumera = resp . listHeaders ( ) ; for ( int idx = 1 ; idx < num ; idx ++ ) { hdr_keys [ idx ] = ( String ) enumera . nextElement ( ) ; hdr_values [ idx ] = resp . getHeader ( hdr_keys [ idx ] ) ; } hdr_values [ 0 ] = resp . getVersion ( ) + " " + resp . getStatusCode ( ) + " " + resp . getReasonLine ( ) ; } catch ( Exception e ) { hdr_keys = hdr_values = new String [ 0 ] ; } }
Cache the list of headers.
Cache the list of headers .
// count number of headers // allocate arrays // fill arrays // the 0'th field is special