当前位置: 首页>>代码示例>>C#>>正文


C# ByteArrayBuffer.WriteByte方法代码示例

本文整理汇总了C#中Db4objects.Db4o.Internal.ByteArrayBuffer.WriteByte方法的典型用法代码示例。如果您正苦于以下问题:C# ByteArrayBuffer.WriteByte方法的具体用法?C# ByteArrayBuffer.WriteByte怎么用?C# ByteArrayBuffer.WriteByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Db4objects.Db4o.Internal.ByteArrayBuffer的用法示例。


在下文中一共展示了ByteArrayBuffer.WriteByte方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestCopy

		public virtual void TestCopy()
		{
			ByteArrayBuffer from = new ByteArrayBuffer(Readerlength);
			for (int i = 0; i < Readerlength; i++)
			{
				from.WriteByte((byte)i);
			}
			ByteArrayBuffer to = new ByteArrayBuffer(Readerlength - 1);
			from.CopyTo(to, 1, 2, 10);
			Assert.AreEqual(0, to.ReadByte());
			Assert.AreEqual(0, to.ReadByte());
			for (int i = 1; i <= 10; i++)
			{
				Assert.AreEqual((byte)i, to.ReadByte());
			}
			for (int i = 12; i < Readerlength - 1; i++)
			{
				Assert.AreEqual(0, to.ReadByte());
			}
		}
开发者ID:erdincay,项目名称:db4o,代码行数:20,代码来源:BufferTestCase.cs

示例2: ToWriteBuffer

		public virtual ByteArrayBuffer ToWriteBuffer(Pointer4 pointer)
		{
			ByteArrayBuffer buffer = new ByteArrayBuffer(pointer.Length());
			_writeBuffer.MergeChildren(this, pointer.Address(), WriteBufferOffset());
			WriteObjectClassID(buffer, ClassMetadata().GetID());
			buffer.WriteByte(HandlerRegistry.HandlerVersion);
			buffer.WriteInt(AspectCount());
			buffer.WriteBitMap(_nullBitMap);
			_writeBuffer.TransferContentTo(buffer);
			return buffer;
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:11,代码来源:MarshallingContext.cs

示例3: Write

		public override void Write(object a_object, ByteArrayBuffer a_bytes)
		{
			char char_ = ((char)a_object);
			a_bytes.WriteByte((byte)(char_ & unchecked((int)(0xff))));
			a_bytes.WriteByte((byte)(char_ >> 8));
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:6,代码来源:CharHandler.cs

示例4: WriteThis

		public override void WriteThis(Transaction trans, ByteArrayBuffer buffer)
		{
			int count = 0;
			int startOffset = buffer._offset;
			IContext context = trans.Context();
			buffer.IncrementOffset(CountLeafAnd3LinkLength);
			if (_isLeaf)
			{
				for (int i = 0; i < _count; i++)
				{
					object obj = InternalKey(trans, i);
					if (obj != No4.Instance)
					{
						count++;
						KeyHandler().WriteIndexEntry(context, buffer, obj);
					}
				}
			}
			else
			{
				for (int i = 0; i < _count; i++)
				{
					if (ChildCanSupplyFirstKey(i))
					{
						Db4objects.Db4o.Internal.Btree.BTreeNode child = (Db4objects.Db4o.Internal.Btree.BTreeNode
							)_children[i];
						object childKey = child.FirstKey(trans);
						if (childKey != No4.Instance)
						{
							count++;
							KeyHandler().WriteIndexEntry(context, buffer, childKey);
							buffer.WriteIDOf(trans, child);
						}
					}
					else
					{
						count++;
						KeyHandler().WriteIndexEntry(context, buffer, Key(i));
						buffer.WriteIDOf(trans, _children[i]);
					}
				}
			}
			int endOffset = buffer._offset;
			buffer._offset = startOffset;
			buffer.WriteInt(count);
			buffer.WriteByte(_isLeaf ? (byte)1 : (byte)0);
			buffer.WriteInt(_parentID);
			buffer.WriteInt(_previousID);
			buffer.WriteInt(_nextID);
			buffer._offset = endOffset;
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:51,代码来源:BTreeNode.cs

示例5: WriteThis

		public override void WriteThis(Transaction trans, ByteArrayBuffer a_writer)
		{
			a_writer.WriteByte(BtreeVersion);
			a_writer.WriteInt(_size);
			a_writer.WriteInt(NodeSize());
			a_writer.WriteIDOf(trans, _root);
		}
开发者ID:erdincay,项目名称:db4o,代码行数:7,代码来源:BTree.cs

示例6: Write

		public override void Write(object a_object, ByteArrayBuffer a_bytes)
		{
			a_bytes.WriteByte(((byte)a_object));
		}
开发者ID:erdincay,项目名称:db4o,代码行数:4,代码来源:ByteHandler.cs

示例7: Write

		public override void Write(Transaction trans, ClassMetadata clazz, ClassAspect aspect
			, ByteArrayBuffer writer)
		{
			writer.WriteByte(aspect.AspectType()._id);
			base.Write(trans, clazz, aspect, writer);
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:6,代码来源:FieldMarshaller2.cs

示例8: Write

		public override void Write(object obj, ByteArrayBuffer buffer)
		{
			buffer.WriteByte(GetEncodedByteValue(obj));
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:4,代码来源:BooleanHandler.cs

示例9: Write

		public override void Write(Transaction trans, ClassMetadata clazz, ClassAspect aspect
			, ByteArrayBuffer writer)
		{
			writer.WriteShortString(trans, aspect.GetName());
			if (!(aspect is FieldMetadata))
			{
				return;
			}
			FieldMetadata field = (FieldMetadata)aspect;
			field.Alive();
			if (field.IsVirtual())
			{
				return;
			}
			ITypeHandler4 handler = field.GetHandler();
			if (handler is StandardReferenceTypeHandler)
			{
				// TODO: ensure there is a test case, to make this happen 
				if (((StandardReferenceTypeHandler)handler).ClassMetadata().GetID() == 0)
				{
					trans.Container().NeedsUpdate(clazz);
				}
			}
			writer.WriteInt(field.FieldTypeID());
			BitMap4 bitmap = new BitMap4(3);
			bitmap.Set(0, field.IsPrimitive());
			bitmap.Set(1, Handlers4.HandlesArray(handler));
			bitmap.Set(2, Handlers4.HandlesMultidimensionalArray(handler));
			// keep the order
			writer.WriteByte(bitmap.GetByte(0));
		}
开发者ID:Galigator,项目名称:db4o,代码行数:31,代码来源:FieldMarshaller0.cs

示例10: WriteBuffer

		protected virtual void WriteBuffer(ByteArrayBuffer buffer, bool shuttingDown)
		{
			SystemData systemData = SystemData();
			WriteSlot(buffer, systemData.IdSystemSlot(), false);
			WriteSlot(buffer, systemData.InMemoryFreespaceSlot(), !shuttingDown);
			buffer.WriteInt(systemData.BTreeFreespaceId());
			buffer.WriteInt(systemData.ConverterVersion());
			buffer.WriteInt(systemData.UuidIndexId());
			Db4oDatabase identity = systemData.Identity();
			buffer.WriteInt(identity == null ? 0 : identity.GetID(_container.SystemTransaction
				()));
			buffer.WriteLong(systemData.LastTimeStampID());
			buffer.WriteByte(systemData.FreespaceSystem());
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:14,代码来源:FileHeaderVariablePart2.cs


注:本文中的Db4objects.Db4o.Internal.ByteArrayBuffer.WriteByte方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。