java–字节流和字符流的转换

此页面是否是列表页或首页?未找到合适正文内容。

java–字节流和字符流的转换

标签:edrjavanullthrow字符importinpuwin10int

package com.machuang.convertStream;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;

public class Demo01 {

public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(
new InputStreamReader(
new FileInputStream( // a.txt 以utf-8编码集保存字符
new File(\”F:/win10/test/a.txt\”) ), \”UTF-8\” ) );

String str = null;
while(null != (str = reader.readLine())) {
System.out.println(str);
}

reader.close();
}

}

java–字节流和字符流的转换

标签:edrjavanullthrow字符importinpuwin10int

原文地址:https://www.cnblogs.com/cappuccinom/p/8810036.html

作者: 鲁大师

为您推荐

返回顶部