import java.io.*;
/**
*
* @author ANDI
*/
public class JavaStream {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
//baca stream dari text
try {
FileInputStream fstream = new FileInputStream("D:\\File Netbeans\\JavaStream\\src\\stream\\test.txt ");
DataInputStream dataInput = new DataInputStream(fstream);
while(dataInput.available()!=0)
{
String data = dataInput.readLine();
System.out.println(data);
}
dataInput.close();
}
catch (Exception e) {
System.err.println("File Input Error");
}
}
}
No comments:
Post a Comment