Java??????????
???????????? ???????[ 2013/11/12 11:18:14 ] ????????
????2?????????????????
/**
* ????????λ?????????????????????????????????
*/
public static void readFileByChars(String fileName) {
File file = new File(fileName);
Reader reader = null;
try {
System.out.println("????????λ?????????????ζ????????");
// ??ζ???????
reader = new InputStreamReader(new FileInputStream(file));
int tempchar;
while ((tempchar = reader.read()) != -1) {
// ????windows?£?
??????????????????????????С?
// ??????????????????????????????С?
// ???????ε?
??????????
?????????????????С?
if (((char) tempchar) != '
') {
System.out.print((char) tempchar);
}
}
reader.close();
} catch (Exception e) {
e.printStackTrace();
}
try {
System.out.println("????????λ?????????????ζ????????");
// ??ζ???????
char[] tempchars = new char[30];
int charread = 0;
reader = new InputStreamReader(new FileInputStream(fileName));
// ???????????????????У?charread???ζ???????
while ((charread = reader.read(tempchars)) != -1) {
// ??????ε?
?????
if ((charread == tempchars.length)
&& (tempchars[tempchars.length - 1] != '
')) {
System.out.print(tempchars);
} else {
for (int i = 0; i < charread; i++) {
if (tempchars[i] == '
') {
continue;
} else {
System.out.print(tempchars[i]);
}
}
}
}
} catch (Exception e1) {
e1.printStackTrace();
} finally {
if (reader != null) {
try {
reader.close();
} catch (IOException e1) {
}
}
}
}
??????

???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11