我正在从 url 读取 zip 文件,现在我想将它直接保存到数据库,而不是使用 java 和 hibernate 物理存储它。
我正在阅读 zip 文件,
URLConnection uCon = null;
URL Url;
byte[] buf;
ZipOutputStream outStream = new ZipOutputStream(new FileOutputStream("mytest.zip"));
Url= new URL(http://xyz.com/pages/info.doc);
uCon = Url.openConnection();
is = uCon.getInputStream();
buf = new byte[size];
is = uCon.getInputStream();
outStream.putNextEntry(new ZipEntry("info.doc"));
while ((ByteRead = is.read(buf)) != -1)
{
outStream.write(buf, 0, ByteRead);
ByteWritten += ByteRead;
}
is.close();
outStream.close();
我不想在创建“mytest.zip”后物理保存它我想直接将它保存在数据库中?可能吗 ?怎么做?
提前致谢。