// with whatever the annotation says, and if that doesn't work, try the other option.
try {
ByteArrayInputStream bais = new ByteArrayInputStream(value.getBytes());
// Start with the annotation
boolean unzip = serializeAnno.zip();
try {
return readObject(bais, unzip);
} catch (IOException ex) { // will be one of ZipException or StreamCorruptedException
if (log.isLoggable(Level.INFO))
log.log(Level.INFO, "Error trying to deserialize object using unzip=" + unzip + ", retrying with " + !unzip, ex);