Now in Baidu WISE team
全部博文(150)
分类: Java
2013-10-29 15:21:34
FileReader filereader = new FileReader("");
BufferedReader bufferedReader=new BufferedReader(filereader); 代码如下 import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.FileWriter; import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.RandomAccessFile; import java.util.HashMap; public class helloworld { private final static int len = 10000000; public static void splitfile(String src, String destfolder) throws Exception{ File f = new File(src); long offset = 0; int index = 0; while(offsetraf.length()){ bufflen = raf.length()-offset; } byte[] buffer = new byte[(int) bufflen]; raf.seek(offset); raf.read(buffer); OutputStream fw = new FileOutputStream(destfile); fw.write(buffer); fw.close(); } /** * @param args * @throws Exception * @throws IOException */ public static void main(String[] args) throws IOException, Exception { // TODO Auto-generated method stub String path = "c:\\royntest\\wison1@ibm.nsf"; splitfile(path, "c:\\royntest"); } }