位置:首頁(yè) > 軟件操作教程 > 編程開(kāi)發(fā) > Java > 問(wèn)題詳情

Java OutputStream類案例

提問(wèn)人:劉旭39發(fā)布時(shí)間: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

繼續(xù)查找其他問(wèn)題的答案?

相關(guān)視頻回答
回復(fù)(0)
返回頂部