public static void writeTypeSystem(CAS aCas, OutputStream aOS, boolean includeIndexDefs) throws IOException { writeJavaObject(includeIndexDefs ? Serialization.serializeCASMgr((CASImpl) aCas) : Serialization.serializeCASMgrTypeSystemOnly((CASImpl) aCas) , aOS); }
public CASCompleteSerializer(CASImpl cas) { this(); this.casMgrSer = Serialization.serializeCASMgr(cas); this.casSer = Serialization.serializeCAS(cas); }
private void writeTypeSystem(CAS cas, DataOutputStream aOS) throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(512); DeflaterOutputStream dos = new DeflaterOutputStream(bos); ObjectOutputStream typeOS = new ObjectOutputStream(dos); CASMgrSerializer casMgrSerializer; try { casMgrSerializer = serializeCASMgr(cas.getJCas().getCasImpl()); typeOS.writeObject(casMgrSerializer); } catch (CASException e) { throw new IOException(e); } typeOS.flush(); dos.flush(); dos.finish(); aOS.writeInt(bos.size()); bos.writeTo(aOS); aOS.flush(); } }
CASMgrSerializer serializer = Serialization.serializeCASMgr((CASMgr) cas); engine.typeSystemInit(serializer);