Code example for URLConnection

Methods: getContentLength, getContentType

0
     */ 
    public ObjectInfo (URLConnection conn, DeviceInfo devInfo, NameFactory f)
    { 
	super (false, new byte [1024], f);
 
	String		type = conn.getContentType ();
 
	// mandatory fields: 
	//	objectCompressedSize 
	//	objectFormatCode 
	//	associationType (if it's an association; we aren't) 
 
	objectCompressedSize = conn.getContentLength ();
 
	// image formats 
	if (type.startsWith ("image/")) {
	    boolean	error = false;
 
	    if ("image/jpeg".equals (type)) {
		if (devInfo.supportsImageFormat (JFIF))
		    objectFormatCode = JFIF;