位置:首页 > 软件操作教程 > 编程开发 > Java > 问题详情

Java OutputStream类案例

提问人:刘旭39发布时间:2020-11-28

OutputStream类

import java.io.File;

import java.io.FileInputStream;

import java.io.FileOutputStream;

import java.io.InputStream;

import java.io.OutputStream;

//OutputStream类

public class OutputStreamDemo {

public static void main(String[] args) {

try { 

File inputFile = new File("Date.json");

File outputFile = new File("output.json");

InputStream inputStream = new FileInputStream(inputFile);

OutputStream outputStream = new FileOutputStream(outputFile);

int i = 0;

while(i != 0) {

i = inputStream.read();

outputStream.wait(i);

}

inputStream.close();

outputStream.close();

} catch (Exception e) {

e.printStackTrace();

}

}

}

G]RM55R)@B%3[J(`C@H1)SR.png

继续查找其他问题的答案?

相关视频回答
回复(0)
返回顶部