Document instance implementation in Java

xiaoxiao2021-03-06  46

Examples of the Java implementation file copy import java.io. *; class copy_file {public static void copyfile (String path1, String path2) throws IOException // use FileInputStream and FileOutStream {FileInputStream fi = new FileInputStream (path1); FileOutputStream fo = new FileOutputStream (PATH2); BYTE DATA [] = new byte [fi.available ()]; fi.read (data); fo.rite (data); fi.close (); fo.close ();}} public class joss {Public static void main (string args []) THROWS IOEXCEPTION {COPY_FILE.COPYFILE ("f: //1.jpg", "f: //2.jpg");}}

转载请注明原文地址:https://www.9cbs.com/read-91051.html

New Post(0)