这是我的代码
- private static void splitFile() throws Exception {
- // TODO Auto-generated method stub
- FileInputStream fis = new FileInputStream("d:\\1.mp3");
- FileOutputStream fos = null;
- byte[] by = new byte[1204 * 1024];
- int len;
- int count = 0;
- while ((len = fis.read(by)) != -1) {
- fos = new FileOutputStream("d:\\splitfile" + (count++) + ".part");
- fos.write(by);//look!here ,here
- fos.close();
- }
- }
复制代码
其中的fos.write(by)和老师视频中的代码fos.write(by,0,len)在理论中有什么区别?
|
|