我有一个数据库,其中包含 blob 和该数据库内的受密码保护的 zip,使用我传统上看到的标准文件对象方法
File zipFile = new File("C:\\file.zip");
net.lingala.zip4j.core.ZipFile table = new net.lingala.zip4j.core.ZipFile(zipFile);
if (table.isEncrypted())
table.setPassword(password);
net.lingala.zip4j.model.FileHeader entry = table.getFileHeader("file_inside_the_zip.txt");
return table.getInputStream(entry); //Decrypted inputsteam!
我的问题是,我如何在不使用临时文件的情况下实现这样的东西,并且只获得 blob 的输入流,到目前为止我有这样的东西
InputStream zipStream = getFileFromDataBase("stuff.zip");
//This point forward I have to save zipStream as a temporary file and use the traditional code above