当前位置:网站首页>Output stream in io stream
Output stream in io stream
2022-07-25 10:15:00 【Look at the bugs】
Byte stream read data
Steps of byte stream reading data
1, An object that creates a byte input stream
2, Adjust the data reading method of byte input stream object
3, Release resources
Read the standard format of data
try {
//FileInputStream(String name) Create byte output stream object
FileInputStream fis = new FileInputStream("fos.txt");
// fis.read();
while((by=fis.read())!=-1){
System.out.println((char)by);
}
fis.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
Read the text data and write another text
// Create byte output output stream object
FileOutputStream fos = new FileOutputStream("F:\\ Inside the bed and outside the window .txt");
FileInputStream fis = new FileInputStream(" Inside the bed and outside the window .txt");
// Read and write data , Copy text file ( Read one byte at a time , Write one byte at a time )
// fis.read();
while((by=fis.read())!=-1){
fos.write(by);
}
Read the data of one byte array at a time
FileInputStream fis = new FileInputStream("fos.txt");
// The method of reading a byte array at a time
byte[] bys=new byte[1024];
int len;
while ((len=fis.read(bys))!=-1) {
System.out.println(new String(bys,0,len));
}
边栏推荐
猜你喜欢

小程序H5获取手机号方案

message from server: “Host ‘xxx.xxx.xxx.xxx‘ is not allowed to connect to this MySQL server“

@Import,Conditional和@ImportResourse注解

Redis使用场景

JDBC总结

message from server: “Host ‘xxx.xxx.xxx.xxx‘ is not allowed to connect to this MySQL server“

静态路由的配置(以华为eNSP为例)
![[deployment of deep learning model] deploy the deep learning model using tensorflow serving + tornado](/img/62/78abf16bb6c66726c6e394c9fb4f81.png)
[deployment of deep learning model] deploy the deep learning model using tensorflow serving + tornado

UE4 LoadingScreen动态加载启动动画

拷贝过来老的项目变成web项目
随机推荐
Usage of string slicing
DHCP的配置(以华为eNSP为例)
多线程——Callable接口,lambda
Nodejs初体验
IO流中的输入流
mysql历史数据补充新数据
力扣刷题组合问题总结(回溯)
See how a junior student of double non-2 (0 Internship) can get an offer from Alibaba and Tencent
Basic knapsack problem
小程序调起微信支付
Filter过滤器详解(监听器以及它们的应用)
conda 配置深度学习环境 pytorch transformers
framework打包合并脚本
鼠标监听,画笔
yarn速查手册
多线程——静态代理模式
Detailed explanation of MySQL database
Redis使用场景
Is binary cross entropy really suitable for multi label classification?
nodejs版本升级或切换的常用方式