Code example for ObjectInputStream

Methods: close, readInt, readLong, readObject

0
	private synchronized void loadFromFile() throws CacheFailureException 
	{ 
		try 
		{ 
			ObjectInputStream input = 
				new ObjectInputStream(
						new QuietBufferedInputStream( 
								new FileInputStream(fullFilename())));
			//first object is the query result 
			qr = (QueryResult)input.readObject();
			//next is a int saying what list item should be read next 
			nextElementPos = input.readInt();
			//last is a timestamp 
			timestamp = new Time();
			timestamp.set(input.readLong());				
			 
			input.close();
		} 
		catch(Exception e)
		{ 
			throw new CacheFailureException("Line 252", e);
		}