public override void WriteBytes(ByteArrayBuffer buffer, int blockedAddress, int addressOffset ) { if (Deploy.debug && !Deploy.flush) { return; } if (Debug4.xbytes && Deploy.overwrite) { if (buffer.CheckXBytes()) { CheckXBytes(blockedAddress, addressOffset, buffer.Length()); } else { buffer.CheckXBytes(true); } } if (DTrace.enabled) { DTrace.WriteBytes.LogLength(blockedAddress + addressOffset, buffer.Length()); } _file.BlockWrite(blockedAddress, addressOffset, buffer._buffer, buffer.Length()); if (_backupFile != null) { _backupFile.BlockWrite(blockedAddress, addressOffset, buffer._buffer, buffer.Length ()); } }
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; }
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 MsgD GetWriterForBuffer(Transaction trans , ByteArrayBuffer buffer) { var writer = GetWriterForLength(trans, buffer .Length()); writer.WriteBytes(buffer._buffer); return writer; }
public static void ProcessCopy(IDefragmentServices services, int sourceID, ISlotCopyHandler command, ByteArrayBuffer sourceReader) { int targetID = services.StrictMappedID(sourceID); Slot targetSlot = services.AllocateTargetSlot(sourceReader.Length()); services.Mapping().MapId(targetID, targetSlot); Db4objects.Db4o.Internal.DefragmentContextImpl context = new Db4objects.Db4o.Internal.DefragmentContextImpl (sourceReader, services); command.ProcessCopy(context); services.TargetWriteBytes(context, targetSlot.Address()); }
internal MsgD GetWriter(Transaction trans, Pointer4 pointer, ByteArrayBuffer buffer , int[] prependInts) { int lengthNeeded = buffer.Length() + LengthForFirst; if (prependInts != null) { lengthNeeded += (prependInts.Length * Const4.IntLength); } MsgD message = GetWriterForLength(trans, lengthNeeded); if (prependInts != null) { for (int i = 0; i < prependInts.Length; i++) { message._payLoad.WriteInt(prependInts[i]); } } AppendPayLoad(message._payLoad, pointer, buffer); return message; }
public void Encrypt(ByteArrayBuffer reader) { if (i_encrypt) { byte[] bytes = reader._buffer; int encryptorOffSet = i_lastEncryptorByte; for (int i = reader.Length() - 1; i >= 0; i--) { bytes[i] -= i_encryptor[encryptorOffSet]; if (encryptorOffSet == 0) { encryptorOffSet = i_lastEncryptorByte; } else { encryptorOffSet--; } } } }
public void Decrypt(ByteArrayBuffer reader) { if (i_encrypt) { var encryptorOffSet = i_lastEncryptorByte; var bytes = reader._buffer; for (var i = reader.Length() - 1; i >= 0; i--) { bytes[i] += i_encryptor[encryptorOffSet]; if (encryptorOffSet == 0) { encryptorOffSet = i_lastEncryptorByte; } else { encryptorOffSet--; } } } }
private void Write(IBin storage, ByteArrayBuffer buffer) { storage.Write(0, buffer._buffer, buffer.Length()); }
public int Length() { return(_source.Length()); }
public override void WriteBytes(ByteArrayBuffer buffer, int address, int addressOffset ) { _memoryBin.Write(address + addressOffset, buffer._buffer, buffer.Length()); }
private int RemainingSize() { return(_delegate.Length() - _delegate.Offset()); }
private void Read(IBin storage, ByteArrayBuffer buffer) { storage.Read(0, buffer._buffer, buffer.Length()); }
private static byte[] BytesToSendFor(string message) { LatinStringIO io = new LatinStringIO(); int marshalledStringLength = io.Length(message); ByteArrayBuffer buffer = new ByteArrayBuffer(marshalledStringLength + Const4.IntLength); buffer.WriteInt(marshalledStringLength); io.WriteLengthAndString(buffer, message); buffer.Seek(0); return buffer.ReadBytes(buffer.Length()); }
public virtual Msg GetWriter(Transaction trans, ByteArrayBuffer bytes) { MsgD msg = GetWriterForLength(trans, bytes.Length()); msg._payLoad.Append(bytes._buffer); return msg; }