public static void main(String[] args) throws IOException {
RandomAccessFile randomAccessFile = new RandomAccessFile("e:/ok.txt","r");
randomAccessFile.seek(75);
String str;
while ((str = randomAccessFile.readLine()) != null) {
// 解决乱码 , 第二个参数是文档编码
str = new String(str.getBytes("8859_1"),"UTF-8");
System.out.println(str);
}
randomAccessFile.close();
}
RandomAccessFile的readLine(),中文乱码情况
最新推荐文章于 2024-07-17 22:41:30 发布