I'm build a project to convert video to byte stream, doing some encryption, and convert agaian stream that have been encrypting into video file. I am using mpeg video..
Anybody know how to convert from byte stream to file video? in case, mpeg file...thanks bef开发者_开发知识库ore
To convert a file into a byte stream, simply open it using FileInputStream.
FileInputStream fis = new FileInputStream ("filename.mov");
You'll probably want to buffer it as video files are quite large
BufferedInputStream bis = new BufferedInputStream (fis);
To write out the file, simply open it using FileOutputStream:
FileOutputStream fos = new FileOutputStream ("fileout.mov");
and then write to it using the FileOutputStream.
精彩评论