Пример #1
0
	public Snapshot(File savedGame) throws IOException, SAXException {
		try {
			load(new GZIPInputStream(new FileInputStream(savedGame)));
		} catch (IOException e) {
			if ("Not in GZIP format".equals(e.getMessage())) {
				load(new FileInputStream(savedGame));
			} else {
				throw e;
			}
		}
	}	
Пример #2
0
	private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException {
		String xml = (String) stream.readObject();
		InputStream is = new ByteArrayInputStream(xml.getBytes());
		load(is);
		logger = LoggerFactory.getLogger(getClass());
	}