Hi,
I'm developing a custom Java MB import and having issues converting the ByteArrayHolder object returned from MB to a GIF binary. Some code is below:-
ByteArrayHolder buffer = new ByteArrayHolder();
mMediaBinServer.retrieveAsGIF(assetID, revision, height, width, true, false, buffer, tagID, jobID);
createFile( buffer.value, workareaVpathTest );
private static void createFile (byte[] theBytes, String fileName) throws java.io.IOException {
saveBytesToStream( new java.io.FileOutputStream( fileName ), theBytes );
}
public static void saveBytesToStream( java.io.OutputStream out, byte[] theBytes )
throws java.io.IOException {
try {
out.write( theBytes );
}
finally {
out.flush();
out.close();
}
}
I'm getting the file from MB and MB indicates that retieval has happened OK. However, the above approach is not giving a valid gif. I suspect it is with the save from an AXIS ByteArrayHolder returned from MB to a file.
Any ideas and pointers ?