本文整理汇总了C#中Db4objects.Db4o.Internal.ByteArrayBuffer.ReadByte方法的典型用法代码示例。如果您正苦于以下问题:C# ByteArrayBuffer.ReadByte方法的具体用法?C# ByteArrayBuffer.ReadByte怎么用?C# ByteArrayBuffer.ReadByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Db4objects.Db4o.Internal.ByteArrayBuffer
的用法示例。
在下文中一共展示了ByteArrayBuffer.ReadByte方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read1
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;
}
示例2: ReadThis
public virtual void ReadThis(ByteArrayBuffer buffer)
{
SystemData().ConverterVersion(buffer.ReadInt());
SystemData().FreespaceSystem(buffer.ReadByte());
buffer.ReadInt();
// was BTreeFreespaceId, converted to slot, can no longer be used
SystemData().IdentityId(buffer.ReadInt());
SystemData().LastTimeStampID(buffer.ReadLong());
SystemData().UuidIndexId(buffer.ReadInt());
}
示例3: 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());
}
}
示例4: Read1
internal override object Read1(ByteArrayBuffer a_bytes)
{
byte ret = a_bytes.ReadByte();
if (ret == True)
{
return true;
}
if (ret == False)
{
return false;
}
return null;
}
示例5: ReadSpec
protected override RawFieldSpec ReadSpec(AspectType aspectType, ObjectContainerBase
stream, ByteArrayBuffer reader)
{
string name = StringHandler.ReadStringNoDebug(stream.Transaction.Context(), reader
);
if (!aspectType.IsFieldMetadata())
{
return new RawFieldSpec(aspectType, name);
}
if (name.IndexOf(Const4.VirtualFieldPrefix) == 0)
{
if (stream._handlers.VirtualFieldByName(name) != null)
{
return new RawFieldSpec(aspectType, name);
}
}
int fieldTypeID = reader.ReadInt();
byte attribs = reader.ReadByte();
return new RawFieldSpec(aspectType, name, fieldTypeID, attribs);
}
示例6: Read
protected override void Read(LocalObjectContainer container, ByteArrayBuffer reader
)
{
NewTimerFileLock(container);
OldEncryptionOff(container);
CheckThreadFileLock(container, reader);
reader.Seek(BlocksizeOffset);
container.BlockSizeReadFromFile(reader.ReadInt());
SystemData systemData = container.SystemData();
systemData.ClassCollectionID(reader.ReadInt());
container.SystemData().IdSystemType(reader.ReadByte());
_variablePart = CreateVariablePart(container);
int variablePartAddress = reader.ReadInt();
int variablePartLength = reader.ReadInt();
_variablePart.Read(variablePartAddress, variablePartLength);
_transactionPointerAddress = reader.ReadInt();
if (_transactionPointerAddress != 0)
{
ByteArrayBuffer buffer = new ByteArrayBuffer(TransactionPointerLength);
buffer.Read(container, _transactionPointerAddress, 0);
systemData.TransactionPointer1(buffer.ReadInt());
systemData.TransactionPointer2(buffer.ReadInt());
}
}
示例7: SignatureMatches
protected virtual bool SignatureMatches(ByteArrayBuffer reader, byte[] signature,
byte version)
{
for (int i = 0; i < signature.Length; i++)
{
if (reader.ReadByte() != signature[i])
{
return false;
}
}
return reader.ReadByte() == version;
}
示例8: ReadNodeHeader
private void ReadNodeHeader(ByteArrayBuffer reader)
{
_count = reader.ReadInt();
byte leafByte = reader.ReadByte();
_isLeaf = (leafByte == 1);
_parentID = reader.ReadInt();
_previousID = reader.ReadInt();
_nextID = reader.ReadInt();
}
示例9: Read1
internal override object Read1(ByteArrayBuffer a_bytes)
{
byte ret = a_bytes.ReadByte();
return ret;
}
示例10: ReadSpec
protected override RawFieldSpec ReadSpec(AspectType aspectType, ObjectContainerBase
stream, ByteArrayBuffer reader)
{
return base.ReadSpec(AspectType.ForByte(reader.ReadByte()), stream, reader);
}
示例11: TestLinkOffset
public virtual void TestLinkOffset()
{
int linkOffset = 7;
MarshallingBuffer buffer = new MarshallingBuffer();
buffer.WriteInt(Data1);
buffer.WriteByte(Data2);
MarshallingBuffer child = buffer.AddChild();
child.WriteInt(Data3);
child.WriteInt(Data4);
MarshallingBuffer grandChild = child.AddChild();
grandChild.WriteInt(Data5);
buffer.MergeChildren(null, 0, linkOffset);
ByteArrayBuffer content = InspectContent(buffer);
ByteArrayBuffer extendedBuffer = new ByteArrayBuffer(content.Length() + linkOffset
);
content.CopyTo(extendedBuffer, 0, linkOffset, content.Length());
extendedBuffer.Seek(linkOffset);
Assert.AreEqual(Data1, extendedBuffer.ReadInt());
Assert.AreEqual(Data2, extendedBuffer.ReadByte());
int address = extendedBuffer.ReadInt();
extendedBuffer.Seek(address);
Assert.AreEqual(Data3, extendedBuffer.ReadInt());
Assert.AreEqual(Data4, extendedBuffer.ReadInt());
address = extendedBuffer.ReadInt();
extendedBuffer.Seek(address);
Assert.AreEqual(Data5, extendedBuffer.ReadInt());
}
示例12: CheckParentTransaction
protected Db4objects.Db4o.Internal.Transaction CheckParentTransaction(Db4objects.Db4o.Internal.Transaction
a_trans, ByteArrayBuffer reader)
{
if (reader.ReadByte() == Const4.SystemTrans && a_trans.ParentTransaction() != null)
{
return a_trans.ParentTransaction();
}
return a_trans;
}
示例13: ReadBuffer
protected virtual void ReadBuffer(ByteArrayBuffer buffer, bool versionsAreConsistent
)
{
buffer.IncrementOffset(ChecksumLength);
SystemData systemData = SystemData();
systemData.IdSystemSlot(ReadSlot(buffer, false));
systemData.InMemoryFreespaceSlot(ReadSlot(buffer, !versionsAreConsistent));
systemData.BTreeFreespaceId(buffer.ReadInt());
systemData.ConverterVersion(buffer.ReadInt());
systemData.UuidIndexId(buffer.ReadInt());
systemData.IdentityId(buffer.ReadInt());
systemData.LastTimeStampID(buffer.ReadLong());
systemData.FreespaceSystem(buffer.ReadByte());
}