code: public static Object deserialize(final Object data, final boolean zipped) throws IOException, ClassNotFoundException {
          final ByteArrayInputStream bais;
          if (data instanceof Binary) {
              bais = new ByteArrayInputStream(((Binary) data).getData());
          } else {
              bais = new ByteArrayInputStream((byte[]) data);
          }
  
          InputStream is = bais;
          try {
              if (zipped) {
                  is = new GZIPInputStream(is);
              }
  
              final ObjectInputStream ois = new ObjectInputStream(is);
              return ois.readObject();
          } finally {
              is.close();
          }
      }
docs: deserializes DBBinary/byte[] to object
  
  @param data   the data to read
  @param zipped true if the data is compressed
  @return the deserialized object
  @throws IOException            thrown when an error is encountered reading the data
  @throws ClassNotFoundException thrown if the Class definition can not be found