Read Notepad Contents using Java

import java.io.*;
public class ReadNotepad
{
public static void main(String[] args)
{
try
{
FileInputStream fstream = new FileInputStream("C:\\Sample.txt");
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine;
while ((strLine = br.readLine()) != null)
{
}
System.out.println("Notepad Contents---->>>>"+strLine);
in.close();
}
catch(Exception e)
{
e.printStackTrace();
}
}
}

Comments

Popular posts from this blog

Integrating ZXing QR Code reader in iPhone / iOS applications

Multiple line of text in UIPickerView

Connect Samsung devices to Kies on Mac