Exporting to an OutputStream via org.mandarax.zkb.ZKBManager
fails in Mandarax 3.4. The problem is that the getIOManager()
function does not return the correct value for an OutputStream. The
original code is:
private IOManager getIOManager(Object object) {
if (object instanceof File) {
File f = (File)object;
if (f.isDirectory()) return DIR_IO;
else return ZIP_IO;
}
else if (object instanceof InputStream) return ZIP_IO;
else if (object instanceof URL) return ZIP_IO;
return null;
}
A fix is the following:
private IOManager getIOManager(Object object) {
if (object instanceof File) {
File f = (File)object;
if (f.isDirectory()) return DIR_IO;
else return ZIP_IO;
}
else if (object instanceof InputStream || object instanceof
OutputStream) return ZIP_IO;
else if (object instanceof URL) return ZIP_IO;
return null;
}
I have tested with the fix, and it works.