String encoding = "GBK";
String Content = "";
String filePath = "E://test//test.inc";
try
{
File f = new File(filePath);
if(f.isFile() && f.exists())
{
InputStreamReader read = new InputStreamReader(new FileInputStream(f),encoding);
BufferedReader input = new BufferedReader(read);
StringBuffer buffer = new StringBuffer();
String text;
while((text = input.readLine()) != null)
buffer.append(text +"/n");
Content = buffer.toString();
}
}
catch(IOException ioException){
System.err.println("File Error!");
}