本文整理汇总了C#中System.Diagnostics.TraceSource.TraceVerbose方法的典型用法代码示例。如果您正苦于以下问题:C# TraceSource.TraceVerbose方法的具体用法?C# TraceSource.TraceVerbose怎么用?C# TraceSource.TraceVerbose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Diagnostics.TraceSource
的用法示例。
在下文中一共展示了TraceSource.TraceVerbose方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FromBytes
public static RedisMessage FromBytes(byte[] data, TraceSource trace)
{
using (var stream = new MemoryStream(data))
{
var message = new RedisMessage();
// read message id from memory stream until SPACE character
var messageIdBuilder = new StringBuilder(20);
do
{
// it is safe to read digits as bytes because they encoded by single byte in UTF-8
int charCode = stream.ReadByte();
if (charCode == -1)
{
trace.TraceVerbose("Received Message could not be parsed.");
throw new EndOfStreamException(Resources.Error_EndOfStreamRedis);
}
char c = (char)charCode;
if (c == ' ')
{
message.Id = ulong.Parse(messageIdBuilder.ToString(), CultureInfo.InvariantCulture);
messageIdBuilder = null;
}
else
{
messageIdBuilder.Append(c);
}
}
while (messageIdBuilder != null);
var binaryReader = new BinaryReader(stream);
int count = binaryReader.ReadInt32();
byte[] buffer = binaryReader.ReadBytes(count);
message.ScaleoutMessage = ScaleoutMessage.FromBytes(buffer);
return message;
}
}