Exemplo n.º 1
0
 public static byte[] serialize(CAS cas) throws IOException {
   ByteArrayOutputStream bos = new ByteArrayOutputStream();
   ObjectOutputStream out = new ObjectOutputStream(bos);
   Serialization.serializeWithCompression(cas, out);
   out.close();
   return bos.toByteArray();
 }
Exemplo n.º 2
0
  public static void deserialize(CAS cas, byte[] byteArray)
      throws IOException, ClassNotFoundException {
    ByteArrayInputStream bis = new ByteArrayInputStream(byteArray);
    ObjectInputStream in = new ObjectInputStream(bis);

    Serialization.deserializeCAS(cas, in);
    in.close();
  }