当前位置:网站首页>I/O案例实操
I/O案例实操
2022-07-25 21:35:00 【51CTO】

创建与文件关联的字节输出流对象 FileOutputStream fos = new
FileOutputStream("c:\\cn8.txt"); //创建可以把字符转成字节的转换流对象,并指定编码
OutputStreamWriter osw = new OutputStreamWriter(fos,"utf-8");
调用转换流,把文字写出去,其实是写到转换流的缓冲区中 osw.write("你好");//写入缓冲区。 osw.close();
创建读取文件的字节流对象

字符输出流

字符输入流
字符输出流+文件


字节输出流+文件操作

更多了解
边栏推荐
- NVIDIA has opened source a comprehensive library of 3D deep learning based on pytorch
- YUV422 to RGB (422sp to 420p)
- The noise reduction effect is increased by more than 6 times! With the microphone inside the headset, this wireless noise reduction headset is unusual!
- Apple estimates that iPhone will give up the Chinese market, and the Chinese industrial chain needs to consider living a hard life
- Research on the scheme of MySQL advanced (VIII) sorting problem
- Programmer's Guide to health quenching 5: introduction to sports Basics
- The role of the resize function is "suggestions collection"
- Airtest solves the problem that a password needs to be entered in the process of "automatic packaging" (the same applies to random bullet frame processing)
- [online tutorial] iptables official tutorial -- learning notes 2
- ag 搜索工具参数详解
猜你喜欢

strcpy()

Huawei occupies half of the folding mobile phone market, proving its irreplaceable position in the high-end market

C#Socket

性能调试 -- Chrome Performance

Canvas fill gradient

pyqt5使用pyqtgraph绘制多个Y值散点图

919. Complete binary tree inserter: simple BFS application problem

Leetcode skimming -- guess the size of numbers II 375 medium
What's special about Huawei's innovative solutions to consolidate the foundation of ERP for small and medium-sized enterprises?

Vivo official website app full model UI adaptation scheme
随机推荐
【面试:并发篇24:多线程:综合练习】顺序控制
When MySQL imports data, it has been changed to CSV utf8 file and the file name is English. Why does it still fail to import
[interview: concurrent Article 23: multithreading: Join] re understanding of join
Fastjson deserialization vulnerability utilization analysis collection
Unity Metaverse(二)、Mixamo & Animator 混合树与动画融合
Detailed explanation of JVM memory model and structure (five model diagrams)
Apple estimates that iPhone will give up the Chinese market, and the Chinese industrial chain needs to consider living a hard life
Huawei occupies half of the folding mobile phone market, proving its irreplaceable position in the high-end market
Unity metaverse (II), mixamo & animator hybrid tree and animation fusion
Leetcode skimming -- guess the size of numbers II 375 medium
Trusted and controllable way of Tencent cloud database
ORIGYN基金会正式启动$OGY Staking,引领新一轮生态利好
My heart's broken! After being cheated by 30000, a 16-year-old girl was unconvinced and cheated by 50000
[database] index
Reading the pointpillar code of openpcdet -- Part 3: Calculation of loss function
腾讯云数据库的可信可控之路
ES6 -- Deconstruction assignment
5、 Pinda general permission system__ PD tools XXS (anti cross site script attack)
Vivo official website app full model UI adaptation scheme
DDD的Go实战