boolean done = false; while (!done) { try { if (fileType == Integer.TYPE) { output.pushInt (inputStream.readInt ()); } else if (fileType == Short.TYPE) { output.pushShort (inputStream.readShort ()); } else if (fileType == Character.TYPE) { output.pushChar (inputStream.readChar ()); } else if (fileType == Float.TYPE) { output.pushFloat (inputStream.readFloat ()); } else if (Class.forName ("java.io.Serializable").isAssignableFrom (fileType)) { Object newObject = inputStream.readObject (); ASSERT (newObject); output.push (newObject); } else { ERROR ("You must define a reader for your type here.\nIf you're trying to read an object, it should be a serializable object\n(and then you won't have to do anything special)."); } done = true; } catch (EOFException e) {  closeFile(); openFile(); } catch (Throwable e) { e.printStackTrace(); ERROR ("There was an error reading from a file (See above)"); } }
boolean done = false; while (!done) { try { if (fileType == Integer.TYPE) { output.pushInt (inputStream.readInt ()); } else if (fileType == Short.TYPE) { output.pushShort (inputStream.readShort ()); } else if (fileType == Character.TYPE) { output.pushChar (inputStream.readChar ()); } else if (fileType == Float.TYPE) { output.pushFloat (inputStream.readFloat ()); } else if (Class.forName ("java.io.Serializable").isAssignableFrom (fileType)) { Object newObject = inputStream.readObject (); ASSERT (newObject); output.push (newObject); } else { ERROR ("You must define a reader for your type here.\nIf you're trying to read an object, it should be a serializable object\n(and then you won't have to do anything special)."); } done = true; } catch (EOFException e) {  closeFile(); openFile(); } catch (Throwable e) { System.err.println (e.getMessage ()); ERROR ("There was an error reading from a file (See above)"); } }
    public void work ()    {	boolean done = false;	while (!done) {	    try {		if (fileType == Integer.TYPE) {		    output.pushInt (inputStream.readInt ());		} else if (fileType == Short.TYPE) {		    output.pushShort (inputStream.readShort ());		} else if (fileType == Character.TYPE) {		    output.pushChar (inputStream.readChar ());		} else if (fileType == Float.TYPE) {		    output.pushFloat (inputStream.readFloat ());		} else if (Class.forName ("java.io.Serializable").isAssignableFrom (fileType)) {		    Object newObject = inputStream.readObject ();		    ASSERT (newObject);		    output.push (newObject);		} else {		    ERROR ("You must define a reader for your type here.\nIf you're trying to read an object, it should be a serializable object\n(and then you won't have to do anything special).");		}		done = true;	    }	    catch (EOFException e) {		// try closing and opening file, to try again		closeFile();		openFile();	    }	    catch (Throwable e)		{		    e.printStackTrace();		    ERROR ("There was an error reading from a file (See above)");		}	}    }