[b]public void read() throws IOException{ [/b]
[color=darkred] File f = new File("d:\\a.xml");
FileInputStream fis = new FileInputStream(f);
OutputStream os = new FileOutputStream("d:\\b.xml.copy");
byte[] buff = new byte[1024 * 1024 * 2];//2M内存
int len;
while ((len = fis.read(buff)) != -1) {
os.write(buff, 0, len);
};
os.close(); fis.close();[/color]
[b]}
[/b]
[color=darkred] File f = new File("d:\\a.xml");
FileInputStream fis = new FileInputStream(f);
OutputStream os = new FileOutputStream("d:\\b.xml.copy");
byte[] buff = new byte[1024 * 1024 * 2];//2M内存
int len;
while ((len = fis.read(buff)) != -1) {
os.write(buff, 0, len);
};
os.close(); fis.close();[/color]
[b]}
[/b]