FileInput - DataOutputStream dat=new DataOutputStream(bos);...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.io.*; class Read{ c public static void main(String args[]){ p try{ FileInputStream file= new FileInputStream("class.dat"); BufferedInputStream buff= new BufferedInputStream(file); DataInputStream data=new DataInputStream(buff); FileOutputStream fos= new FileOutputStream("output.java"); BufferedOutputStream bos= new BufferedOutputStream(fos);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: DataOutputStream dat=new DataOutputStream(bos); boolean eof=false; int count=0; while(!eof){ int input=data.readInt(); System.out.print(input+" "); if(input==-1) eof=true; else count++; } file.close(); f }catch(IOException e){ System.out.println("Error--"+e.toString()); } } }...
View Full Document

This note was uploaded on 04/26/2010 for the course COMPUTER S Java2 taught by Professor Kwstasmixail during the Spring '10 term at Technical University of Crete.

Ask a homework question - tutors are online