当前位置:网站首页>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();
创建读取文件的字节流对象

字符输出流

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


字节输出流+文件操作

更多了解
边栏推荐
- 5、 Pinda general permission system__ PD tools XXS (anti cross site script attack)
- Interviewer of large factory: how to quickly query a table with tens of millions of data?
- Decompile app
- cuda_ error_ out_ of_ Memory (out of memory)
- ES6 --- four powerful operators (?,? =,?.,?:)
- All non isomorphic subgraphs of a directed complete graph of order 3 (number of different hook graphs)
- Intel base instruction -- bnd
- 作为测试,如何理解线程同步异步
- 零基础学习CANoe Panel(17)—— Panel CAPL Function
- Zero basic learning canoe panel (17) -- panel CAPL function
猜你喜欢

ONEFLOW V0.8.0 officially released

作为测试,如何理解线程同步异步

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)

As a test, how to understand thread synchronization and asynchrony

Oracle RAC RMAN backup error ora-19501 ora-15081

Reading the pointpillar code of openpcdet -- Part 3: Calculation of loss function

My heart's broken! After being cheated by 30000, a 16-year-old girl was unconvinced and cheated by 50000
![[interview: concurrent Article 23: multithreading: Join] re understanding of join](/img/ee/5160a55e776336ba844abe8e9db72a.png)
[interview: concurrent Article 23: multithreading: Join] re understanding of join

Achieve accurate positioning based on Tencent map, and realize the attendance punch function of wechat applet

Basic method of black box (function) test
随机推荐
An interview question combining defer and function in golang
Intel base instruction -- bnd
Fusing and degrading Sentinel
大厂面试官:千万级数据量的表,如何进行快速查询?
测试用例和缺陷报告模板
C#程序设计的6大原则
Vivo official website app full model UI adaptation scheme
C#常见的集合
DDD go practice
MPI学习笔记(二):矩阵相乘的两种实现方法
Experience sharing of system architecture designers preparing for the exam: from point to surface
函数栈帧的创建和销毁
租房二三事
The adequacy of source evaluation forum · observation model test
2022 latest examination questions and answers of eight members (standard staff) of Shanghai Architecture
DDD的Go实战
Basic method of black box (function) test
Huawei occupies half of the folding mobile phone market, proving its irreplaceable position in the high-end market
Airtest解决“自动装包”过程中需要输入密码的问题(同适用于随机弹框处理)
ONEFLOW V0.8.0 officially released