Code example for ObjectInputStream

Methods: closereadObject

0
	public static Object deserializeFromBytes(byte[] bytes) { 
		Object object = null; 
		try { 
			ByteArrayInputStream bais = new ByteArrayInputStream(bytes); 
			InflaterInputStream zin = new InflaterInputStream(bais); 
			ObjectInputStream oin = new ObjectInputStream(zin); 
			object = oin.readObject(); 
			oin.close(); 
			return object; 
		} catch (Exception ex) { 
			ex.printStackTrace(); 
		} // try 
		return null; 
	} // deserializeFromBytes 
	 
	/** 
	 * Hash the password used for seeding the {@link DeterministicECKeyPool}. 
	 * This should be of a sufficient number of iterations as to add a 
	 * substantial amount of CPU overhead, but without creating an unreasonable 
	 * bottleneck to unlocking a wallet.