我在想這样拼接出来还能不能播放呢?
我就实验了一下结果是:
可以的
- import java.io.*;
- /**
- * Created by Void Young on 5:30 PM 7/16/2016 .
- * IDEA-Test .
- */
- public class TestMusic {
- public static void main (String[] args) throws IOException{
- try(
- BufferedInputStream bis1 = new BufferedInputStream (new FileInputStream ("z:/1.mp3"));
- BufferedInputStream bis2 = new BufferedInputStream (new FileInputStream ("z:/2.mp3"));
- BufferedOutputStream bos = new BufferedOutputStream (new FileOutputStream ("z:/3.mp3"));
- ) {
- int b;
- while (( b = bis1.read () ) != - 1) {
- bos.write (b);
- }
- while (( b = bis2.read () ) != - 1) {
- bos.write (b);
- }
- }
- }
- }
复制代码 |