FileDocCategorySizeDatePackage
TestBinaryInputStream.javaAPI DocExample856Sun Feb 24 12:11:08 GMT 2002None

TestBinaryInputStream

public class TestBinaryInputStream extends Object

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

		// Set up the streams
		File inFile = new File("C:\\Sample1.dat");
		
		// FileInputStream reads bytes
		FileInputStream ifs = new FileInputStream(inFile);
		
		// DataOuputStream writes floats, ints, doubles
		DataInputStream inDataStream = new DataInputStream(ifs);
		
		// Try reading a few primitive values from the stream.
		System.out.println("Integer " + inDataStream.readInt());
		System.out.println("Integer " + inDataStream.readInt());
        System.out.println("Characters " + inDataStream.readUTF());
        System.out.println("Double " + inDataStream.readDouble());
        System.out.println("Long " + inDataStream.readLong());
        System.out.println("char " + inDataStream.readChar());
		inDataStream.close();