inflater.setInput(contents.array(), 0, contents.limit());
byte[] buf = new byte[4096];
ByteArrayOutputStream baos = new ByteArrayOutputStream(contents.limit());
try {
while (! inflater.finished()) {
int inflated = inflater.inflate(buf, 0, buf.length);
baos.write(buf, 0, inflated);
}
} catch (Exception e) {
log.severe("DB| inflation error: "+e.getMessage());
log.log(Level.FINE, "details: ", e);