Code example for ObjectInputStream

Methods: close, readByte, readObject

0
                (byte) 5, (byte) 0x79, (byte) 0x74, (byte) 0, (byte) 1, 
                (byte) 'R', (byte) 0x79, (byte) 0x77, (byte) 1, (byte) 24 }; 
        assertTrue("incorrect output", Arrays.equals(input, result));
 
        ois = new ObjectInputStreamSubclass(loadStream());
        assertEquals("Wrong result from readObject()", "R", ois.readObject());
        assertEquals("Wrong result from readByte()", 24, ois.readByte());
        ois.close();
    } 
 
	private static class ResolveObjectTest implements Serializable {
		Object field1, field2;
	} 
 
	private static class ResolveObjectInputStream extends ObjectInputStream {
		ResolveObjectInputStream(InputStream in)
				throws StreamCorruptedException, IOException { 
			super(in);
		} 
 
		public void enableResolve() {