67,512
社区成员
发帖
与我相关
我的任务
分享
public class Test {
public static void main(String[] args) {
try {
File file = new File("D:\\DMDownLoad\\Song\\陈翔-承诺.mp3");
FileInputStream in = new FileInputStream(file);
File fileRs = new File("D:\\DMDownLoad\\Song\\陈翔-承诺.wav");
FileOutputStream os = new FileOutputStream(fileRs);
int n = 0;// 每次读取的字节长度
byte[] bb = new byte[1024];// 存储每次读取的内容
while ((n = in.read(bb)) != -1) {
os.write(bb, 0, n);// 将读取的内容,写入到输出流当中
}
os.close();// 关闭输入输出流
in.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
以上方法可行没问题啊?是我理解错了你的要求了么[/quote]
-----------------------------------
谢谢 大虾
结贴晚了。
public class Test {
public static void main(String[] args) {
try {
File file = new File("D:\\DMDownLoad\\Song\\陈翔-承诺.mp3");
FileInputStream in = new FileInputStream(file);
File fileRs = new File("D:\\DMDownLoad\\Song\\陈翔-承诺.wav");
FileOutputStream os = new FileOutputStream(fileRs);
int n = 0;// 每次读取的字节长度
byte[] bb = new byte[1024];// 存储每次读取的内容
while ((n = in.read(bb)) != -1) {
os.write(bb, 0, n);// 将读取的内容,写入到输出流当中
}
os.close();// 关闭输入输出流
in.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
以上方法可行没问题啊?是我理解错了你的要求了么[/quote]
---------------------
这样的话改个后缀名就好了,写什么程序啊
public class Test {
public static void main(String[] args) {
try {
File file = new File("D:\\DMDownLoad\\Song\\陈翔-承诺.mp3");
FileInputStream in = new FileInputStream(file);
File fileRs = new File("D:\\DMDownLoad\\Song\\陈翔-承诺.wav");
FileOutputStream os = new FileOutputStream(fileRs);
int n = 0;// 每次读取的字节长度
byte[] bb = new byte[1024];// 存储每次读取的内容
while ((n = in.read(bb)) != -1) {
os.write(bb, 0, n);// 将读取的内容,写入到输出流当中
}
os.close();// 关闭输入输出流
in.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
以上方法可行没问题啊?是我理解错了你的要求了么