本文整理汇总了C#中BEncodedString.Encode方法的典型用法代码示例。如果您正苦于以下问题:C# BEncodedString.Encode方法的具体用法?C# BEncodedString.Encode怎么用?C# BEncodedString.Encode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BEncodedString
的用法示例。
在下文中一共展示了BEncodedString.Encode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: benStringEncodingBuffered
public void benStringEncodingBuffered()
{
byte[] data = System.Text.Encoding.UTF8.GetBytes("22:this is my test string");
BEncodedString benString = new BEncodedString("this is my test string");
byte[] result = new byte[benString.LengthInBytes()];
benString.Encode(result, 0);
Assert.IsTrue(Toolbox.ByteMatch(data, result));
}
示例2: benStringEncoding2
public void benStringEncoding2()
{
byte[] data = System.Text.Encoding.UTF8.GetBytes("0:");
BEncodedString benString = new BEncodedString("");
Assert.IsTrue(Toolbox.ByteMatch(data, benString.Encode()));
}
示例3: benStringEncoding2
public void benStringEncoding2()
{
var data = Encoding.UTF8.GetBytes("0:");
var benString = new BEncodedString("");
Assert.True(Toolbox.ByteMatch(data, benString.Encode()));
}
示例4: benStringEncodingBuffered
public void benStringEncodingBuffered()
{
var data = Encoding.UTF8.GetBytes("22:this is my test string");
var benString = new BEncodedString("this is my test string");
var result = new byte[benString.LengthInBytes()];
benString.Encode(result, 0);
Assert.True(Toolbox.ByteMatch(data, result));
}
示例5: benStringEncoding
public void benStringEncoding()
{
var data = Encoding.UTF8.GetBytes("22:this is my test string");
var benString = new BEncodedString("this is my test string");
Assert.True(Toolbox.ByteMatch(data, benString.Encode()));
}