/// <exception cref="Db4objects.Db4o.CorruptionException"></exception> internal override object Read1(ByteArrayBuffer a_bytes) { int offset = a_bytes._offset; object ret = Read(a_bytes._buffer, a_bytes._offset); a_bytes._offset = offset + LinkLength(); return ret; }
private byte[] ReadName(LatinStringIO sio, ByteArrayBuffer reader) { byte[] nameBytes = sio.Bytes(reader); reader.IncrementOffset(nameBytes.Length); nameBytes = Platform4.UpdateClassName(nameBytes); return nameBytes; }
public CacheContributingObjectReader(ClientTransaction transaction, IClientSlotCache slotCache, ByteArrayBuffer reader) { _reader = reader; _transaction = transaction; _slotCache = slotCache; }
public override void CompleteInterruptedTransaction(int transactionId1, int transactionId2 ) { if (!System.IO.File.Exists(LockFileName(_fileName))) { return; } if (!LockFileSignalsInterruptedTransaction()) { return; } ByteArrayBuffer buffer = new ByteArrayBuffer(Const4.IntLength); OpenLogFile(); Read(_logFile, buffer); int length = buffer.ReadInt(); if (length > 0) { buffer = new ByteArrayBuffer(length); Read(_logFile, buffer); buffer.IncrementOffset(Const4.IntLength); ReadWriteSlotChanges(buffer); } DeleteLockFile(); CloseLogFile(); DeleteLogFile(); }
public MockMarshallingContext(IObjectContainer objectContainer) { _objectContainer = objectContainer; _header = new ByteArrayBuffer(1000); _payLoad = new ByteArrayBuffer(1000); _current = _header; }
protected override void WriteBuffer(ByteArrayBuffer buffer, bool shuttingDown) { base.WriteBuffer(buffer, shuttingDown); SystemData systemData = SystemData(); buffer.WriteInt(systemData.IdToTimestampIndexId()); buffer.WriteInt(systemData.TimestampToIdIndexId()); }
// _key, _slot._address, _slot._length public override object Read(ByteArrayBuffer buffer) { int id = buffer.ReadInt(); Db4objects.Db4o.Internal.Slots.Slot slot = new Db4objects.Db4o.Internal.Slots.Slot (buffer.ReadInt(), buffer.ReadInt()); return new Db4objects.Db4o.Internal.Ids.IdSlotTree(id, slot); }
public Msg ReplyFromServer() { ByteArrayBuffer bytes = null; // readWriterByID may fail in certain cases, for instance if // and object was deleted by another client try { lock (ContainerLock()) { bytes = Container().ReadBufferById(Transaction(), _payLoad.ReadInt(), _payLoad.ReadInt () == 1); } if (bytes == null) { bytes = new ByteArrayBuffer(0); } } catch (Db4oRecoverableException exc) { throw; } catch (Exception exc) { throw new Db4oRecoverableException(exc); } return Msg.ReadBytes.GetWriter(Transaction(), bytes); }
public static Db4objects.Db4o.Internal.SerializedGraph Read(ByteArrayBuffer buffer ) { int id = buffer.ReadInt(); int length = buffer.ReadInt(); return new Db4objects.Db4o.Internal.SerializedGraph(id, buffer.ReadBytes(length)); }
public virtual void WriteIndexEntry(IContext context, ByteArrayBuffer reader, object obj) { MappedIDPair mappedIDs = (MappedIDPair)obj; _origHandler.WriteIndexEntry(context, reader, mappedIDs.Orig()); _mappedHandler.WriteIndexEntry(context, reader, mappedIDs.Mapped()); }
public _IRunnable_65(FileHeaderVariablePart2 _enclosing, int length, ByteArrayBuffer buffer) { this._enclosing = _enclosing; this.length = length; this.buffer = buffer; }
public TreeReader(ByteArrayBuffer a_bytes, IReadable a_template, bool a_orderOnRead ) { i_template = a_template; i_bytes = a_bytes; i_orderOnRead = a_orderOnRead; }
public UnmarshallingContext(Transaction transaction, ByteArrayBuffer buffer, ObjectReference @ref, int addToIDTree, bool checkIDTree) : base(transaction, buffer, null, @ref ) { _addToIDTree = addToIDTree; _checkIDTree = checkIDTree; }
public virtual void WriteIndexEntry(IContext context, ByteArrayBuffer writer, object obj) { Slot slot = (Slot)obj; writer.WriteInt(slot.Address()); writer.WriteInt(slot.Length()); }
protected override void ReadBuffer(ByteArrayBuffer buffer, bool versionsAreConsistent ) { base.ReadBuffer(buffer, versionsAreConsistent); SystemData systemData = SystemData(); systemData.IdToTimestampIndexId(buffer.ReadInt()); systemData.TimestampToIdIndexId(buffer.ReadInt()); }
private void AppendPayLoad(StatefulBuffer target, Pointer4 pointer, ByteArrayBuffer payLoad) { target.WriteInt(payLoad.Length()); target.WriteInt(pointer.Id()); target.WriteInt(pointer.Address()); target.Append(payLoad._buffer); }
public bool ContainsTheSame(Db4objects.Db4o.Internal.ByteArrayBuffer other) { if (other != null) { return(Arrays4.Equals(_buffer, other._buffer)); } return(false); }
public Db4objects.Db4o.CS.Internal.Messages.MsgD GetWriterForBuffer(Transaction trans , ByteArrayBuffer buffer) { Db4objects.Db4o.CS.Internal.Messages.MsgD writer = GetWriterForLength(trans, buffer .Length()); writer.WriteBytes(buffer._buffer); return writer; }
internal override object Read1(ByteArrayBuffer a_bytes) { byte b1 = a_bytes.ReadByte(); byte b2 = a_bytes.ReadByte(); char ret = (char)((b1 & unchecked((int)(0xff))) | ((b2 & unchecked((int)(0xff))) << 8)); return ret; }
internal static void WriteShort(int a_short, ByteArrayBuffer a_bytes) { for (int i = 0; i < Const4.ShortBytes; i++) { a_bytes._buffer[a_bytes._offset++] = (byte)(a_short >> ((Const4.ShortBytes - 1 - i) * 8)); } }
public virtual byte[] Bytes(ByteArrayBuffer buffer) { int len = buffer.ReadInt(); len = BytesPerChar() * len; byte[] res = new byte[len]; System.Array.Copy(buffer._buffer, buffer._offset, res, 0, len); return res; }
protected virtual void ProduceSomeFreeSpace() { var length = 300; var slot = LocalContainer().AllocateSlot(length); var buffer = new ByteArrayBuffer(length); LocalContainer().WriteBytes(buffer, slot.Address(), 0); LocalContainer().Free(slot); }
public override void WriteThis(Transaction trans, ByteArrayBuffer writer) { writer.WriteInt(Size()); for (int i = 0; i < _ints.Length; i++) { writer.WriteInt(_ints[i]); } }
public _IProcedure4_39(ClassMarshaller _enclosing, Transaction trans, ClassMetadata clazz, ByteArrayBuffer writer) { this._enclosing = _enclosing; this.trans = trans; this.clazz = clazz; this.writer = writer; }
public DefragmentContextImpl(Db4objects.Db4o.Internal.DefragmentContextImpl parentContext , ObjectHeader header) { _source = parentContext._source; _target = parentContext._target; _services = parentContext._services; _objectHeader = header; }
public MsgD GetWriter(Transaction trans, Pointer4 pointer, ClassMetadata classMetadata , int param, ByteArrayBuffer buffer) { return GetWriter(trans, pointer, buffer, new[] { classMetadata.GetID(), param }); }
public virtual Db4objects.Db4o.Internal.ByteArrayBuffer ReadPayloadReader(int offset , int length) { Db4objects.Db4o.Internal.ByteArrayBuffer payLoad = new Db4objects.Db4o.Internal.ByteArrayBuffer (length); System.Array.Copy(_buffer, offset, payLoad._buffer, 0, length); return(payLoad); }
public MsgD GetWriterForBuffer(Transaction trans , ByteArrayBuffer buffer) { var writer = GetWriterForLength(trans, buffer .Length()); writer.WriteBytes(buffer._buffer); return writer; }
protected override FileHeader NewOnSignatureMatch(LocalObjectContainer file, ByteArrayBuffer reader) { if (SignatureMatches(reader, Signature, Version())) { return CreateNew(); } return null; }
public override object ReadShort(ByteArrayBuffer buffer) { short value = UnmarshallShort(buffer); if (value == short.MaxValue) { return null; } return value; }
public static short UnmarshallShort(ByteArrayBuffer buffer) { int ret = 0; for (int i = 0; i < Const4.ShortBytes; i++) { ret = (ret << 8) + (buffer._buffer[buffer._offset++] & unchecked((int)(0xff))); } return (short)ret; }
public override object ReadLong(ByteArrayBuffer buffer) { long value = buffer.ReadLong(); if (value == long.MaxValue) { return null; } return value; }
public static void Write(ByteArrayBuffer buffer, Db4objects.Db4o.Internal.TreeInt tree) { Write(buffer, tree, tree == null ? 0 : tree.Size()); }
public static void Write(ByteArrayBuffer buffer, TreeInt tree) { Write(buffer, tree, tree == null ? 0 : tree.Size()); }
public void ReadThis(Db4objects.Db4o.Internal.Transaction trans, ByteArrayBuffer buffer) { }
/// <exception cref="System.IO.IOException"></exception> public ByteArrayBuffer SourceBufferById(int sourceId) { ByteArrayBuffer sourceBuffer = _services.SourceBufferByID(sourceId); return(sourceBuffer); }
public virtual void CopyTo(Db4objects.Db4o.Internal.ByteArrayBuffer to, int fromOffset , int toOffset, int length) { System.Array.Copy(_buffer, fromOffset, to._buffer, toOffset, length); }
public virtual void TransferContentTo(ByteArrayBuffer buffer) { TransferContentTo(buffer, Length()); }
public virtual void WriteIndexEntry(IContext context, ByteArrayBuffer a_writer, object a_object) { }
public void WriteEncrypt(ByteArrayBuffer buffer, int address, int addressOffset) { _handlers.Encrypt(buffer); WriteBytes(buffer, address, addressOffset); _handlers.Decrypt(buffer); }
public override void WriteBytes(ByteArrayBuffer buffer, int address, int addressOffset ) { _memoryBin.Write(address + addressOffset, buffer._buffer, buffer.Length()); }
public virtual void Read(ByteArrayBuffer buffer, IReadable template) { Clear(); _tree = new TreeReader(buffer, template).Read(); Changed(); }
public TreeReader(ByteArrayBuffer a_bytes, IReadable a_template) : this(a_bytes, a_template, false) { }
public virtual void WriteOwnID(Transaction trans, ByteArrayBuffer writer) { Write(trans); writer.WriteInt(GetID()); }
public virtual void WriteThis(Db4objects.Db4o.Internal.Transaction trans, ByteArrayBuffer buffer) { }
public virtual void Write(ByteArrayBuffer buffer) { buffer.WriteInt(_key); }
public virtual object Read(ByteArrayBuffer buffer) { return(new Db4objects.Db4o.Internal.TreeInt(buffer.ReadInt())); }
public abstract void WriteBytes(ByteArrayBuffer buffer, int blockedAddress, int addressOffset );
public virtual object ReadIndexEntry(IContext context, ByteArrayBuffer a_reader) { return(null); }
public virtual object ReadIndexEntry(IContext context, ByteArrayBuffer reader) { return(new CommitTimestampSupport.TimestampEntry(reader.ReadInt(), reader.ReadLong ())); }
public DefragmentContextImpl(ByteArrayBuffer source, IDefragmentServices services ) : this(source, services, null) { }
private void IncrementStringOffset(LatinStringIO sio, ByteArrayBuffer buffer) { sio.ReadLengthAndString(buffer); }
public DefragmentContextImpl(ByteArrayBuffer source, Db4objects.Db4o.Internal.DefragmentContextImpl context) : this(source, context._services, context._objectHeader) { }
public virtual object Read(ByteArrayBuffer buffer) { return(new TreeInt(buffer.ReadInt())); }
public void TargetWriteBytes(int address, ByteArrayBuffer buffer) { _services.TargetWriteBytes(buffer, address); }
public virtual object ReadPrefetch(Db4objects.Db4o.Internal.Transaction trans, ByteArrayBuffer buffer, int addToIDTree) { UnmarshallingContext context = new UnmarshallingContext(trans, buffer, this, addToIDTree , false); context.ActivationDepth(new FixedActivationDepth(1, ActivationMode.Prefetch)); return(context.Read()); }
public virtual void Write(ByteArrayBuffer buffer) { buffer.WriteInt(_id); buffer.WriteInt(Length()); buffer.Append(_bytes); }
public _IVisitor4_97(ByteArrayBuffer buffer) { this.buffer = buffer; }
protected virtual void Read(Transaction trans, ByteArrayBuffer reader) { ReadThis(trans, reader); SetStateOnRead(reader); }
public abstract void WriteThis(Transaction arg1, ByteArrayBuffer arg2);