Here you can find the source of readFileUTF_8(String filePath)
public static String readFileUTF_8(String filePath)
//package com.java2s; //License from project: Apache License import java.io.*; public class Main { public static String readFileUTF_8(String filePath) { String templetContent = ""; try {//ww w. ja va 2s .c o m FileInputStream fileinputstream = new FileInputStream(filePath); int length = fileinputstream.available(); byte bytes[] = new byte[length]; fileinputstream.read(bytes); fileinputstream.close(); templetContent = new String(bytes, "UTF-8"); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return templetContent; } }