outState = new DataOutputStream(fosState);
outState = new DataOutputStream(new BufferedOutputStream(fosState));
	public void saveState(StateImpl state, File stateFile, File lazyFile) throws IOException {		DataOutputStream outLazy = null;		DataOutputStream outState = null;		FileOutputStream fosLazy = null;		FileOutputStream fosState = null;		try {			BundleDescription[] bundles = state.getBundles();			StateHelperImpl.getInstance().sortBundles(bundles);			// need to prime the object table with all bundles			// this allows us to write only indexes to bundles in the lazy data			for (int i = 0; i < bundles.length; i++)				addToObjectTable(bundles[i]);			// first write the lazy data to get the offsets and sizes to the lazy data			fosLazy = new FileOutputStream(lazyFile);			outLazy = new DataOutputStream(fosLazy);			for (int i = 0; i < bundles.length; i++)				writeBundleDescriptionLazyData(bundles[i], outLazy);			// now write the state data			fosState = new FileOutputStream(stateFile);			outState = new DataOutputStream(fosState);			outState.write(StateReader.STATE_CACHE_VERSION);			if (writePrefix(state, outState))				return;			outState.writeLong(state.getTimeStamp());			Dictionary[] propSet = state.getPlatformProperties();			outState.writeInt(propSet.length);			for (int i = 0; i < propSet.length; i++){				Dictionary props = propSet[i];				outState.writeInt(StateImpl.PROPS.length);				for (int j = 0; j < StateImpl.PROPS.length; j++)					writePlatformProp(props.get(StateImpl.PROPS[j]), outState);			}			outState.writeInt(bundles.length);			if (bundles.length == 0)				return;			for (int i = 0; i < bundles.length; i++)				// write out each bundle with the force flag set to make sure				// the data is written at least once in the non-lazy state data				writeBundleDescription(bundles[i], outState, true);			outState.writeBoolean(state.isResolved());			state.setDynamicCacheChanged(false);		} finally {			if (outLazy != null)				try {					outLazy.flush();					fosLazy.getFD().sync();				} catch (IOException e) {					// do nothing, we tried				}				try {					outLazy.close();				} catch (IOException e) {					// do nothing				}			if (outState != null)				try {					outState.flush();					fosState.getFD().sync();				} catch (IOException e) {					// do nothing, we tried				}				try {					outState.close();				} catch (IOException e) {					// do nothing				}		}	}