/** * 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; }
/** * Convert a CAS to a CASSerializer object. * This object used in testing * Excludes metadata about the CAS * @param cas the source for a new CASSerializer object * @return a corresponding CASSerializer object */ public static CASSerializer serializeNoMetaData(CAS cas) { CASSerializer ser = new CASSerializer(); ser.addNoMetaData((CASImpl) cas); return ser; }
public void reinit(CASSerializer ser) { if (this != this.svd.baseCAS) { this.svd.baseCAS.reinit(ser); return; } this.resetNoQuestions(); reinit(ser.getHeapMetadata(), ser.getHeapArray(), ser.getStringTable(), ser.getFSIndex(), ser .getByteArray(), ser.getShortArray(), ser.getLongArray()); }
/** * 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); }
CASSerializer casSerializerOut = new CASSerializer();
/** * 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); }
CASSerializer casSerializerOut = new CASSerializer();
public void reinit(CASCompleteSerializer casCompSer) { if (this != this.svd.baseCAS) { this.svd.baseCAS.reinit(casCompSer); return; } setupCasFromCasMgrSerializer(casCompSer.getCASMgrSerializer()); // deserialize heap CASSerializer casSer = casCompSer.getCASSerializer(); reinit(casSer.getHeapMetadata(), casSer.getHeapArray(), casSer.getStringTable(), casSer .getFSIndex(), casSer.getByteArray(), casSer.getShortArray(), casSer.getLongArray()); // we also need to throw away the JCAS. A new JCAS will be created on // the next // call to getJCas(). As with the CAS, we are counting on the fact that // this happens only in a service, where JCAS handles are not held on // to. this.jcas = null; // this.sofa2jcasMap.clear(); clearTrackingMarks(); }
/** * 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); }
addCAS(cas, ostream, false);
CASSerializer serializer = new CASSerializer();
/** * 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); }
break; 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)