コード例 #1
0
 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
                                    ());
     }
 }
コード例 #2
0
ファイル: MsgD.cs プロジェクト: erdincay/db4o
		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;
		}
コード例 #3
0
		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);
		}
コード例 #4
0
ファイル: MsgD.cs プロジェクト: masroore/db4o
 public MsgD GetWriterForBuffer(Transaction trans
     , ByteArrayBuffer buffer)
 {
     var writer = GetWriterForLength(trans, buffer
         .Length());
     writer.WriteBytes(buffer._buffer);
     return writer;
 }
コード例 #5
0
        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());
        }
コード例 #6
0
		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;
		}
コード例 #7
0
 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--;
             }
         }
     }
 }
コード例 #8
0
ファイル: HandlerRegistry.cs プロジェクト: pondyond/db4o
 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--;
             }
         }
     }
 }
コード例 #9
0
		private void Write(IBin storage, ByteArrayBuffer buffer)
		{
			storage.Write(0, buffer._buffer, buffer.Length());
		}
コード例 #10
0
		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
					());
			}
		}
コード例 #11
0
ファイル: HandlerRegistry.cs プロジェクト: erdincay/db4o
		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--;
					}
				}
			}
		}
コード例 #12
0
 public int Length()
 {
     return(_source.Length());
 }
コード例 #13
0
 public override void WriteBytes(ByteArrayBuffer buffer, int address, int addressOffset
     )
 {
     _memoryBin.Write(address + addressOffset, buffer._buffer, buffer.Length());
 }
コード例 #14
0
 public override void WriteBytes(ByteArrayBuffer buffer, int address, int addressOffset
                                 )
 {
     _memoryBin.Write(address + addressOffset, buffer._buffer, buffer.Length());
 }
コード例 #15
0
ファイル: MarshallingBuffer.cs プロジェクト: danfma/db4o-net
 private int RemainingSize()
 {
     return(_delegate.Length() - _delegate.Offset());
 }
コード例 #16
0
		private void Read(IBin storage, ByteArrayBuffer buffer)
		{
			storage.Read(0, buffer._buffer, buffer.Length());
		}
コード例 #17
0
		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());
		}
コード例 #18
0
ファイル: SslSocketTestCase.cs プロジェクト: erdincay/db4o
		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());
		}
コード例 #19
0
ファイル: MReadBytes.cs プロジェクト: erdincay/db4o
		public virtual Msg GetWriter(Transaction trans, ByteArrayBuffer bytes)
		{
			MsgD msg = GetWriterForLength(trans, bytes.Length());
			msg._payLoad.Append(bytes._buffer);
			return msg;
		}
コード例 #20
0
ファイル: HandlerRegistry.cs プロジェクト: masroore/db4o
 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--;
             }
         }
     }
 }