⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fileinput.java

📁 提供了常用的JAVA技术的示例
💻 JAVA
字号:
package FileInput;import java.io.*;import java.util.*;public class FileInput {    static FileInputStream fis;    static FileOutputStream fos;    static File f,f1;    static byte b[]=new byte[1400];    static byte out[]=new byte[200];    static int I,J;    static String s,o;    static String read="i am a girl";    public static void init()throws IOException{    try{      fis=new FileInputStream("E:\\二厂\\程序\\monitor\\files\\difference");      fos=new FileOutputStream("e:/h.xml");      //f=new File("1.txt");      //f1=new File("3.txt");    }    catch(FileNotFoundException e){      System.out.println("\n显示信息:"+e.getMessage());    }    try{      I=fis.read(b);    }    catch(IOException e){      System.out.println("\nIO异常:"+e.getMessage());    }    for(int j=0;j<read.length();j++){      fos.write(read.charAt(j));    }    /*for(int i=0;i<180;i++){        fos.write(b[i]);    }*/    s=new String(b);    //o=new String(b);    /*System.out.println("name:"+f.getName());    System.out.println("len="+f.length()+" bytes");    System.out.println("lastModified: "+ (new Date(f1.lastModified())).toString());    System.out.println(f.canWrite()?"canwrite!":"can not writed");    System.out.println("创建新文件?"+(f1.createNewFile()?"cancreat!":"cannot"));    System.out.println("\n-----file: 1.txt 显示!------");*/    System.out.println(s);    //System.out.println("\n---2.txt: copy from 1.txt---");    //System.out.println(o);}public static void main(String a[])throws IOException{    init();  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -