public static void main(String[] args) throws IOException {
InputStream r = new FileInputStream(new File("aaa.txt"));
ByteArrayOutputStream byteout = new ByteArrayOutputStream();
byte tmp[] = new byte[1024];
byte context[];
int i = 0;
while ((i = r.read(tmp)) != -1) {
byteout.write(tmp);
}
context = byteout.toByteArray();
String str = new String(context, "utf-8");// 解码中文
// 分隔行
String stra[] = str.split(" \n ");
StringBuffer sb = new StringBuffer();
for (int n = 0; n < stra.length; n++) {
sb.append(stra[n]);
}
 System.out.println(sb.toString());
 String s = sb.toString();
}