如何玩从Byte数组视频? [英] How to play a video from Byte array?

查看:200
本文介绍了如何玩从Byte数组视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个应用程序需要的视频文件,这是工作相当well.But的方法,我用的视频解密的回报作为Byte数组加密。所以,反正是有,我可以使用数组播放视频,而无需创建一个新的文件。

I am working on an app which needs encryption of video files which is working quite well.But the method I am using to decrypt returns the video as in Byte array. So is there anyway that I can play the video using that array without creating a new file.

我的方法解密:

  private static byte[] decrypt(byte[] raw, byte[] encrypted) throws EncrypterException {
SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
try {
    final Cipher cipher = Cipher.getInstance("AES");
    cipher.init(Cipher.DECRYPT_MODE, skeySpec);

    return cipher.doFinal(encrypted);

} catch (Exception e) {
    throw new EncrypterException(e);
}
}

请帮我,我坚持在这里?

Please help me I am stuck here ?

推荐答案

你通常如何播放视频?你送 InputStrem 实例球员。 所以,你 ByteArrayInputStream的,它包装的字节数组,并将其发送给玩家。

How do you usually play video? You send InputStrem instance to player. So you ByteArrayInputStream that wraps your byte array and send it to the player.

这篇关于如何玩从Byte数组视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆