import java.io.*; public class ccc { public static void main(String[] args) throws IOException{ String str="12345abcde@#%&*软件工程"; File file=new File("d:\\tset.txt"); file.createNewFile(); FileInputStream fr=new FileInputStream(file); FileOutputStream fw=new FileOutputStream(file); byte[]bw=str.getBytes(); fw.write(bw); byte[]br=str.getBytes(); fr.read(br); String str$=new String(br); System.out.println(str$); fr.close(); fw.close(); } }