FileDocCategorySizeDatePackage
SerialDemoXML.javaAPI DocExample1100Sun Mar 07 14:48:30 GMT 2004None

SerialDemoXML

public class SerialDemoXML extends SerialDemoAbstractBase
Show the XML serialization added to "java.beans.*" in JDK1.4. Subclass "SerialDemoAbstratBase" to get most of infrastructure

Fields Summary
public static final String
FILENAME
Constructors Summary
Methods Summary
public voiddump()
Display the data

		XMLDecoder inp = new XMLDecoder(		// NEEDS JDK 1.4
			new BufferedInputStream(
				new FileInputStream(FILENAME)));
		System.out.println(inp.readObject());
		inp.close();
	
public static voidmain(java.lang.String[] args)


	       
		new SerialDemoXML().save();
		new SerialDemoXML().dump();
	
public voidwrite(java.lang.Object theGraph)
Save the data to disk.

		XMLEncoder os = new XMLEncoder(		// NEEDS JDK 1.4
			new BufferedOutputStream(
				new FileOutputStream(FILENAME)));
		os.writeObject(theGraph);
		os.close();