开发者

How to convert Bystream Video to file video in java

开发者 https://www.devze.com 2023-02-24 05:25 出处:网络
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..

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消