本文整理汇总了C#中ByteArrayBuffer类的典型用法代码示例。如果您正苦于以下问题:C# ByteArrayBuffer类的具体用法?C# ByteArrayBuffer怎么用?C# ByteArrayBuffer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ByteArrayBuffer类属于命名空间,在下文中一共展示了ByteArrayBuffer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CompleteInterruptedTransaction
public override void CompleteInterruptedTransaction(int transactionId1, int transactionId2
)
{
if (!File.Exists(LockFileName(_fileName)))
{
return;
}
if (!LockFileSignalsInterruptedTransaction())
{
return;
}
var buffer = new ByteArrayBuffer(Const4.IntLength);
OpenLogFile();
Read(_logFile, buffer);
var length = buffer.ReadInt();
if (length > 0)
{
buffer = new ByteArrayBuffer(length);
Read(_logFile, buffer);
buffer.IncrementOffset(Const4.IntLength);
ReadWriteSlotChanges(buffer);
}
DeleteLockFile();
CloseLogFile();
DeleteLogFile();
}
开发者ID:masroore,项目名称:db4o,代码行数:26,代码来源:FileBasedTransactionLogHandler.cs
示例2: WriteIndexEntry
public virtual void WriteIndexEntry(IContext context, ByteArrayBuffer writer, object
obj)
{
var slot = (Slot) obj;
writer.WriteInt(slot.Address());
writer.WriteInt(slot.Length());
}
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:SlotHandler.cs
示例3: Read
public static SerializedGraph Read(ByteArrayBuffer buffer
)
{
var id = buffer.ReadInt();
var length = buffer.ReadInt();
return new SerializedGraph(id, buffer.ReadBytes(length));
}
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:SerializedGraph.cs
示例4: UnmarshallingContext
public UnmarshallingContext(Transaction transaction, ByteArrayBuffer buffer, ObjectReference
@ref, int addToIDTree, bool checkIDTree) : base(transaction, buffer, null, @ref
)
{
_addToIDTree = addToIDTree;
_checkIDTree = checkIDTree;
}
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:UnmarshallingContext.cs
示例5: Encode
private static ByteArrayBuffer Encode(Encoding charset, string @string)
{
ByteBuffer encoded = charset.Encode(CharBuffer.Wrap(@string));
ByteArrayBuffer bab = new ByteArrayBuffer(encoded.Remaining());
bab.Append(((byte[])encoded.Array()), encoded.Position(), encoded.Remaining());
return bab;
}
开发者ID:jonlipsky,项目名称:couchbase-lite-net,代码行数:7,代码来源:HttpMultipart.cs
示例6: Read
// _key, _slot._address, _slot._length
public override object Read(ByteArrayBuffer buffer)
{
var id = buffer.ReadInt();
var slot = new Slot
(buffer.ReadInt(), buffer.ReadInt());
return new IdSlotTree(id, slot);
}
开发者ID:masroore,项目名称:db4o,代码行数:8,代码来源:IdSlotTree.cs
示例7: WriteBuffer
protected override void WriteBuffer(ByteArrayBuffer buffer, bool shuttingDown)
{
base.WriteBuffer(buffer, shuttingDown);
var systemData = SystemData();
buffer.WriteInt(systemData.IdToTimestampIndexId());
buffer.WriteInt(systemData.TimestampToIdIndexId());
}
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:FileHeaderVariablePart3.cs
示例8: ReadName
private byte[] ReadName(LatinStringIO sio, ByteArrayBuffer reader)
{
var nameBytes = sio.Bytes(reader);
reader.IncrementOffset(nameBytes.Length);
nameBytes = Platform4.UpdateClassName(nameBytes);
return nameBytes;
}
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:ClassMarshaller.cs
示例9: WriteIndexEntry
public virtual void WriteIndexEntry(IContext context, ByteArrayBuffer reader, object
obj)
{
var mappedIDs = (MappedIDPair) obj;
_origHandler.WriteIndexEntry(context, reader, mappedIDs.Orig());
_mappedHandler.WriteIndexEntry(context, reader, mappedIDs.Mapped());
}
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:MappedIDPairHandler.cs
示例10: Bytes
public virtual byte[] Bytes(ByteArrayBuffer buffer)
{
var len = buffer.ReadInt();
len = BytesPerChar()*len;
var res = new byte[len];
Array.Copy(buffer._buffer, buffer._offset, res, 0, len);
return res;
}
开发者ID:masroore,项目名称:db4o,代码行数:8,代码来源:LatinStringIO.cs
示例11: WriteShort
internal static void WriteShort(int a_short, ByteArrayBuffer a_bytes)
{
for (var i = 0; i < Const4.ShortBytes; i++)
{
a_bytes._buffer[a_bytes._offset++] = (byte) (a_short >> ((Const4.ShortBytes - 1 -
i)*8));
}
}
开发者ID:masroore,项目名称:db4o,代码行数:8,代码来源:ShortHandler.cs
示例12: Read1
internal override object Read1(ByteArrayBuffer a_bytes)
{
var b1 = a_bytes.ReadByte();
var b2 = a_bytes.ReadByte();
var ret = (char) ((b1 & unchecked(0xff)) | ((b2 & unchecked(0xff))
<< 8));
return ret;
}
开发者ID:masroore,项目名称:db4o,代码行数:8,代码来源:CharHandler.cs
示例13: MultipartReader
public MultipartReader(string contentType, MultipartReaderDelegate delegate_)
{
this.contentType = contentType;
this.delegate_ = delegate_;
this.buffer = new ByteArrayBuffer(1024);
this.state = MultipartReader.MultipartReaderState.kAtStart;
ParseContentType();
}
开发者ID:Redth,项目名称:couchbase-lite-net,代码行数:8,代码来源:MultipartReader.cs
示例14: ReadBuffer
protected override void ReadBuffer(ByteArrayBuffer buffer, bool versionsAreConsistent
)
{
base.ReadBuffer(buffer, versionsAreConsistent);
var systemData = SystemData();
systemData.IdToTimestampIndexId(buffer.ReadInt());
systemData.TimestampToIdIndexId(buffer.ReadInt());
}
开发者ID:masroore,项目名称:db4o,代码行数:8,代码来源:FileHeaderVariablePart3.cs
示例15: ReadFloat
public override object ReadFloat(ByteArrayBuffer bytes)
{
var value = UnmarshallFloat(bytes);
if (float.IsNaN(value))
{
return null;
}
return value;
}
开发者ID:masroore,项目名称:db4o,代码行数:9,代码来源:PrimitiveMarshaller0.cs
示例16: ReadDouble
public override object ReadDouble(ByteArrayBuffer buffer)
{
var value = UnmarshalDouble(buffer);
if (double.IsNaN(value))
{
return null;
}
return value;
}
开发者ID:masroore,项目名称:db4o,代码行数:9,代码来源:PrimitiveMarshaller0.cs
示例17: ReadLong
public override object ReadLong(ByteArrayBuffer buffer)
{
var value = buffer.ReadLong();
if (value == long.MaxValue)
{
return null;
}
return value;
}
开发者ID:masroore,项目名称:db4o,代码行数:9,代码来源:PrimitiveMarshaller0.cs
示例18: WriteIndexEntry
public virtual void WriteIndexEntry(IContext context, ByteArrayBuffer a_writer, object
a_object)
{
if (a_object == null)
{
a_object = PrimitiveNull();
}
Write(a_object, a_writer);
}
开发者ID:masroore,项目名称:db4o,代码行数:9,代码来源:PrimitiveHandler.cs
示例19: ReadWriteSlotChanges
protected virtual void ReadWriteSlotChanges(ByteArrayBuffer buffer)
{
var slotChanges = new LockedTree();
slotChanges.Read(buffer, new SlotChange(0));
if (WriteSlots(new _IVisitable_65(slotChanges)))
{
FlushDatabaseFile();
}
}
开发者ID:masroore,项目名称:db4o,代码行数:9,代码来源:TransactionLogHandler.cs
示例20: ReadShort
public override object ReadShort(ByteArrayBuffer buffer)
{
var value = UnmarshallShort(buffer);
if (value == short.MaxValue)
{
return null;
}
return value;
}
开发者ID:masroore,项目名称:db4o,代码行数:9,代码来源:PrimitiveMarshaller0.cs
注:本文中的ByteArrayBuffer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论