IO流的操作.
public static void main(String[] args) throws IOException {
StringBuffer text = new StringBuffer("Hello File");
byte[] b = text.toString().getBytes();
File f = new File("d:\\text.xml");
f.createNewFile();
FileOutputStream fos = new FileOutputStream(f);
fos.write(b);
fos.close();
}
public static void main(String[] args) throws IOException {
StringBuffer text = new StringBuffer("Hello File");
byte[] b = text.toString().getBytes();
File f = new File("d:\\text.xml");
f.createNewFile();
FileOutputStream fos = new FileOutputStream(f);
fos.write(b);
fos.close();
}