Example #1
0
 @Override
 public <T> T deserialize(InputStream in, Class<T> cls) throws IOException {
   try {
     return genson.deserialize(in, cls);
   } catch (TransformationException e) {
     throw new IOException(e.toString(), e);
   }
 }
Example #2
0
 @Override
 public void serialize(Object value, boolean pretty, OutputStream out) throws IOException {
   try {
     if (pretty) {
       gensonPretty.serialize(value, out);
     } else {
       genson.serialize(value, out);
     }
   } catch (TransformationException e) {
     throw new IOException(e.toString(), e);
   }
 }