本文整理汇总了C#中Db4objects.Db4o.Internal.ByteArrayBuffer.Length方法的典型用法代码示例。如果您正苦于以下问题:C# ByteArrayBuffer.Length方法的具体用法?C# ByteArrayBuffer.Length怎么用?C# ByteArrayBuffer.Length使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Db4objects.Db4o.Internal.ByteArrayBuffer
的用法示例。
在下文中一共展示了ByteArrayBuffer.Length方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AppendPayLoad
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);
}
示例2: GetWriterForBuffer
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: GetWriterForBuffer
public MsgD GetWriterForBuffer(Transaction trans
, ByteArrayBuffer buffer)
{
var writer = GetWriterForLength(trans, buffer
.Length());
writer.WriteBytes(buffer._buffer);
return writer;
}
示例4: GetWriter
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;
}
示例5: WriteBytes
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
());
}
}
示例6: Encrypt
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--;
}
}
}
}
示例7: WriteBytes
public override void WriteBytes(ByteArrayBuffer buffer, int address, int addressOffset
)
{
_memoryBin.Write(address + addressOffset, buffer._buffer, buffer.Length());
}
示例8: GetWriter
public virtual Msg GetWriter(Transaction trans, ByteArrayBuffer bytes)
{
MsgD msg = GetWriterForLength(trans, bytes.Length());
msg._payLoad.Append(bytes._buffer);
return msg;
}
示例9: Write
private void Write(IBin storage, ByteArrayBuffer buffer)
{
storage.Write(0, buffer._buffer, buffer.Length());
}
示例10: Read
private void Read(IBin storage, ByteArrayBuffer buffer)
{
storage.Read(0, buffer._buffer, buffer.Length());
}
示例11: ProcessCopy
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());
}
示例12: BytesToSendFor
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());
}
示例13: Decrypt
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--;
}
}
}
}