/** * Serialize CAS data without heap-internal meta data. Currently used for serialization to C++. * * @param casImpl The CAS to be serialized. */ public void addNoMetaData(CASImpl casImpl) { addCAS(casImpl, false); }
/** * Add the CAS to be serialized. Note that we need the implementation here, the interface is not * enough. * * @param cas The CAS to be serialized. */ public void addCAS(CASImpl cas) { addCAS(cas, true); }
addCAS(cas, ostream, false);
/** * Convert a CAS to a CASSerializer object. * This object used in testing , and also to pass things via the CPP JNI interface, and the Vinci protocol * @param cas the CAS which serves as the source for a new CASSerializer object * @return a corresponding CASSerializer object */ public static CASSerializer serializeCAS(CAS cas) { CASSerializer ser = new CASSerializer(); ser.addCAS((CASImpl) cas); return ser; }
/** * Serialize a CAS including what's indexed, to an output stream * Uses uncompressed binary serialization * @param cas the CAS to serialize * @param ostream the output stream */ public static void serializeCAS(CAS cas, OutputStream ostream) { CASSerializer ser = new CASSerializer(); ser.addCAS((CASImpl) cas, ostream); }
/** * Serializes CAS data added or modified after the tracking Marker was created and writes it * to the output stream in Delta CAS format * using uncompressed binary format * @param cas the Cas to serialize * @param ostream the output stream * @param mark the cas mark (for delta CASes) */ public static void serializeCAS(CAS cas, OutputStream ostream, Marker mark) { if (!mark.isValid() ) { throw new CASRuntimeException(CASRuntimeException.INVALID_MARKER); } CASSerializer ser = new CASSerializer(); ser.addCAS((CASImpl) cas, ostream, mark); }
case BINARY_TSI: // Java-serialized CAS without type system CASSerializer ser = new CASSerializer(); ser.addCAS((CASImpl) aCas, docOS, true); break; case COMPRESSED: // Binary compressed CAS without type system (form 4)