public IObjectInfo Decode(ByteArrayInputStream @is) { long id = PrimitiveCodec.ReadLong(@is); if (id == -1) { return(null); } return(new LazyObjectReference(this._enclosing.Transaction(), (int)id)); }
public void Encode(ByteArrayOutputStream os, IObjectInfo info) { PrimitiveCodec.WriteLong(os, info.GetInternalID()); long sourceDatabaseId = ((FrozenObjectInfo)info).SourceDatabaseId(this._enclosing .Transaction()); PrimitiveCodec.WriteLong(os, sourceDatabaseId); PrimitiveCodec.WriteLong(os, ((FrozenObjectInfo)info).UuidLongPart()); PrimitiveCodec.WriteLong(os, info.GetCommitTimestamp()); }
public virtual bool ProcessAtClient() { ByteArrayInputStream @is = new ByteArrayInputStream(_payLoad._buffer); int dispatcherID = PrimitiveCodec.ReadInt(@is); CallbackObjectInfoCollections callbackInfos = Decode(@is); Container().ThreadPool().Start(ReflectPlatform.SimpleName(GetType()) + ": calling commit callbacks thread" , new _IRunnable_111(this, callbackInfos, dispatcherID)); return(true); }
private void EncodeObjectInfoCollection(ByteArrayOutputStream os, IObjectInfoCollection collection, MCommittedInfo.IObjectInfoEncoder encoder) { IEnumerator iter = collection.GetEnumerator(); while (iter.MoveNext()) { IObjectInfo obj = (IObjectInfo)iter.Current; encoder.Encode(os, obj); } PrimitiveCodec.WriteLong(os, -1); }
public virtual MCommittedInfo Encode(CallbackObjectInfoCollections callbackInfo, int dispatcherID) { ByteArrayOutputStream os = new ByteArrayOutputStream(); PrimitiveCodec.WriteInt(os, dispatcherID); byte[] bytes = EncodeInfo(callbackInfo, os); MCommittedInfo committedInfo = (MCommittedInfo)GetWriterForLength(Transaction(), bytes.Length + Const4.IntLength); committedInfo._payLoad.Append(bytes); return(committedInfo); }
public IObjectInfo Decode(ByteArrayInputStream @is) { long id = PrimitiveCodec.ReadLong(@is); if (id == -1) { return(null); } long sourceDatabaseId = PrimitiveCodec.ReadLong(@is); Db4oDatabase sourceDatabase = null; if (sourceDatabaseId > 0) { sourceDatabase = (Db4oDatabase)this._enclosing.Container().GetByID(this._enclosing .Transaction(), sourceDatabaseId); } long uuidLongPart = PrimitiveCodec.ReadLong(@is); long version = PrimitiveCodec.ReadLong(@is); return(new FrozenObjectInfo(null, id, sourceDatabase, uuidLongPart, version)); }
public void Encode(ByteArrayOutputStream os, IObjectInfo info) { PrimitiveCodec.WriteLong(os, info.GetInternalID()); }
/// <exception cref="System.IO.IOException"></exception> protected virtual void WriteByteArray(ByteArrayOutputStream os, byte[] signaturePart ) { PrimitiveCodec.WriteLong(os, signaturePart.Length); os.Write(signaturePart); }