if (lastIDSaved > bundledata.getBundleID())
getFirstLastID(); if (firstIDSaved == bundledata.getBundleID())
	public void save(DataOutputStream os) throws IOException {		if (lastIDSaved > bundledata.getBundleID())			saveChainCache.clear();		lastIDSaved = bundledata.getBundleID();		BundleFile bundleFile = bundledata.getBundleFile();		CertificateChain[] chains = null;		String md5Result = null;		String shaResult = null;		Hashtable digests = null;		Hashtable results = null;		if (bundleFile instanceof SignedBundleFile) {			SignedBundleFile signedFile = (SignedBundleFile) bundleFile;			chains = signedFile.chains;			md5Result = signedFile.manifestMD5Result;			shaResult = signedFile.manifestSHAResult;			digests = signedFile.digests4entries;			results = signedFile.results4entries;		}		os.writeBoolean(chains != null);		if (chains == null)			return;		os.writeInt(chains.length);		for (int i = 0; i < chains.length; i++) {			int cacheIdx = saveChainCache.indexOf(chains[i]);			os.writeInt(cacheIdx);			if (cacheIdx >= 0)				continue;			saveChainCache.add(chains[i]);			os.writeUTF(chains[i].getChain());			os.writeBoolean(chains[i].isTrusted());			Certificate[] certs = chains[i].getCertificates();			os.writeInt(certs == null ? 0 : certs.length);			if (certs != null)				for (int j = 0; j < certs.length; j++) {					byte[] certBytes;					try {						certBytes = certs[j].getEncoded();					} catch (CertificateEncodingException e) {						throw new IOException(e.getMessage());					}					os.writeInt(certBytes.length);					os.write(certBytes);				}		}		os.writeInt(digests.size());		for (Enumeration entries = digests.keys(); entries.hasMoreElements();) {			String entry = (String) entries.nextElement();			MessageDigest[] mds = (MessageDigest[]) digests.get(entry);			byte[][] result = (byte[][]) results.get(entry);			os.writeUTF(entry);			os.writeInt(mds.length);			for (int i = 0; i < mds.length; i++) {				if (mds[i] == SignedBundleFile.md5)					os.writeInt(0);				else					os.writeInt(1);				os.writeInt(result[i].length);				os.write(result[i]);			}		}		os.writeBoolean(md5Result != null);		if (md5Result != null)			os.writeUTF(md5Result);		os.writeBoolean(shaResult != null);		if (shaResult != null)			os.writeUTF(shaResult);	}