java网络编程

    xiaoxiao2021-03-25  84

    package com.test.net.utils; import java.io.FileInputStream; import java.io.FileOutputStream; /** * @author Administrator * 字节流操作 */ public class ByteStreamOper { public static void main(String[] args) throws Exception { fileInputStream(); } public static void fileInputStream() throws Exception { FileInputStream fis = new FileInputStream("test.txt"); FileOutputStream fos = new FileOutputStream("text.txt"); int len = 0; byte[] bt = new byte[1024]; while ((len = fis.read(bt)) != -1) { fos.write(bt, 0, len); System.out.println("写入成功内容为::___" + new String(bt, "UTF-8")); } fis.close(); fos.close(); } }

    //

    转载请注明原文地址: https://ju.6miu.com/read-12050.html

    最新回复(0)