- public class FileWriterText
- {
- public static void main(String[] args)
- {
- BufferedInputStream bin=null;
- //BufferedOutputStream out=null;
- FileWriter file=null;
- try
- {
- bin=new BufferedInputStream(new FileInputStream("D:\\我不是男神 - 张亮,张悦轩.mp3"));
- file=new FileWriter(new FileOutputStream("D:\\1.mp3"),true);
- int ch=0;
- while((ch=bin.read())!=-1)
- {
- file.println(ch);
- }
- }
- catch(IOException e)
- {}
- finally
- {
- try{
- bin.close();
- }
- catch(IOException e)
- {}
- try{
- file.close();
- }
- catch(IOException e)
- {}
- }
- }
- }
复制代码 file=new FileWriter(new FileOutputStream("D:\\1.mp3"),true);这边不可以这么封装??
|
|