FileDocCategorySizeDatePackage
WriteBinary.javaAPI DocExample549Sun Feb 08 17:57:30 GMT 2004None

WriteBinary

public class WriteBinary extends Object
Write some data in binary.
author
Ian F. Darwin, http://www.darwinsys.com/
version
$Id: WriteBinary.java,v 1.3 2004/02/08 23:57:29 ian Exp $

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] argv)

		int i = 42;
		double d = Math.PI;
		String FILENAME = "binary.dat";
		DataOutputStream os = new DataOutputStream(
			new FileOutputStream(FILENAME));
		os.writeInt(i);
		os.writeDouble(d);
		os.close();
		System.out.println("Wrote " + i + ", " + d + " to file " + FILENAME);