本文整理汇总了C#中FlatBuffers.FlatBufferBuilder.ToProtocolMessage方法的典型用法代码示例。如果您正苦于以下问题:C# FlatBufferBuilder.ToProtocolMessage方法的具体用法?C# FlatBufferBuilder.ToProtocolMessage怎么用?C# FlatBufferBuilder.ToProtocolMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FlatBuffers.FlatBufferBuilder
的用法示例。
在下文中一共展示了FlatBufferBuilder.ToProtocolMessage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateAssignSessionId
public static byte[] CreateAssignSessionId(uint sessionId)
{
var fbb = new FlatBufferBuilder(1024);
var oAssignSessionId = Messages.AssignSessionId.CreateAssignSessionId(fbb, sessionId);
Messages.AssignSessionId.FinishAssignSessionIdBuffer(fbb, oAssignSessionId);
return fbb.ToProtocolMessage(MessageIds.AssignSessionId);
}
示例2: Serialize
public byte[] Serialize()
{
var fbb = new FlatBufferBuilder(1024);
var msg = MetadataMsg.CreateMetadata(fbb,
ColorFrameWidth, ColorFrameHeight,
DepthFrameWidth, DepthFrameHeight);
fbb.Finish(msg.Value);
return fbb.ToProtocolMessage(MessageIds.Metadata);
}
示例3: CreateInputCommand
public static byte[] CreateInputCommand(CommandFrame frame)
{
var fbb = new FlatBufferBuilder(1024);
var oFrame = CreateCommandFrameOffset(frame, fbb);
var oInputCommand = Messages.InputCommand.CreateInputCommand(fbb, oFrame);
Messages.InputCommand.FinishInputCommandBuffer(fbb, oInputCommand);
return fbb.ToProtocolMessage(MessageIds.InputCommand);
}
示例4: Serialize
public byte[] Serialize()
{
var fbb = new FlatBufferBuilder(1024);
var bodies = Array.ConvertAll(Bodies, body => body.Serialize(fbb));
var msg = BodyFrameDataMsg.CreateBodyFrameData(fbb,
RelativeTime.Ticks,
BodyFrameDataMsg.CreateBodiesVector(fbb, bodies));
fbb.Finish(msg.Value);
return fbb.ToProtocolMessage(MessageIds.BodyFrameData);
}
示例5: CreateSyncFrame
public static byte[] CreateSyncFrame(CommandFrame[] frames)
{
var fbb = new FlatBufferBuilder(1024);
var oFrames = CreateFrameOffsets(fbb, frames);
var vFrames = Messages.SyncFrame.CreateFramesVector(fbb, oFrames);
var oSyncFrame = Messages.SyncFrame.CreateSyncFrame(fbb, vFrames);
Messages.SyncFrame.FinishSyncFrameBuffer(fbb, oSyncFrame);
return fbb.ToProtocolMessage(MessageIds.SyncFrame);
}