我想创建一个需要将视频进行压缩并且用户必须通过密码验证才能打开文件的应用程序,这是否可能?
如果可以的话,你们能否提供一些示例代码呢? 谢谢, 问候
我想创建一个需要将视频进行压缩并且用户必须通过密码验证才能打开文件的应用程序,这是否可能?
如果可以的话,你们能否提供一些示例代码呢? 谢谢, 问候
OutputStream out = new ZipOutputStream(new CipherOutputStream(new FileOutputStream(...)), cipher);
InputStream in = new ZipInputStream(new CipherInputStream(new FileInputStream(...)), cipher);
我不确定您需要什么,但如果您想拥有受密码保护的 zip 文件,可以使用 this library:这是一些取自那里的代码片段:
Zip:
ZipArchive zipArchive = new ZipArchive();
zipArchive.zip(targetPath,destinationPath,password);
解压缩:
ZipArchive zipArchive = new ZipArchive();
zipArchive.unzip(targetPath,destinationPath,password);