本文整理汇总了C#中IValueWriter.WriteBytes方法的典型用法代码示例。如果您正苦于以下问题:C# IValueWriter.WriteBytes方法的具体用法?C# IValueWriter.WriteBytes怎么用?C# IValueWriter.WriteBytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IValueWriter
的用法示例。
在下文中一共展示了IValueWriter.WriteBytes方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WritePayload
public override void WritePayload(IValueWriter writer)
{
base.WritePayload(writer);
writer.WriteBytes(InternalOwnEndPoint.Address.GetAddressBytes());
writer.WriteInt32(InternalOwnEndPoint.Port);
writer.WriteBytes(ExternalPeerEndPoint.Address.GetAddressBytes());
writer.WriteInt32(ExternalPeerEndPoint.Port);
}
示例2: WritePayload
public override void WritePayload(ISerializationContext context, IValueWriter writer)
{
using (var ms = new MemoryStream())
{
ScreenFrame.Save(ms, ImageFormat.Png);
writer.WriteBytes(ms.GetBuffer());
}
}
示例3: Serialize
public void Serialize(ISerializationContext context, IValueWriter writer)
{
if (!writer.WriteBool (this.publicKey != null))
return;
writer.WriteBytes (this.publicKey);
writer.WriteInt32 (this.exponentOffset);
}
示例4: WritePayload
public override void WritePayload(ISerializationContext context, IValueWriter writer)
{
writer.WriteInt32 (SourceId);
writer.WriteInt32 (Sequence);
writer.WriteByte ((byte)Data.Length);
for (int i = 0; i < Data.Length; ++i)
writer.WriteBytes (Data[i]);
}
示例5: WritePayload
public override void WritePayload(ISerializationContext context, IValueWriter writer)
{
writer.WriteUInt16 (OriginalMessageId);
writer.WriteByte (Count);
writer.WriteBytes (Payload, this.offset, this.length);
}
示例6: WritePayload
public override void WritePayload(ISerializationContext context, IValueWriter writer)
{
writer.WriteBytes (AESKey);
writer.WriteString (PublicAuthenticationKeyType.GetSimpleName());
writer.WriteBytes (PublicAuthenticationKey);
}
示例7: Serialize
public void Serialize(ISerializationContext context, IValueWriter writer, IAsymmetricCrypto crypto)
{
if (!writer.WriteBool (this.publicKey != null))
return;
writer.WriteBytes (crypto.Encrypt (Exponent));
int first = this.Modulus.Length / 2;
writer.WriteBytes (crypto.Encrypt (Modulus.Copy (0, first)));
writer.WriteBytes (crypto.Encrypt (Modulus.Copy (first, Modulus.Length - first)));
}
示例8: Serialize
public void Serialize(IValueWriter writer, IPublicKeyCrypto crypto)
{
if (writer.WriteBool (D != null))
{
writer.WriteBytes (crypto.Encrypt (D));
writer.WriteBytes (crypto.Encrypt (DP));
writer.WriteBytes (crypto.Encrypt (DQ));
writer.WriteBytes (crypto.Encrypt (InverseQ));
writer.WriteBytes (crypto.Encrypt (P));
writer.WriteBytes (crypto.Encrypt (Q));
}
if (writer.WriteBool (this.publicKey != null))
{
writer.WriteBytes (crypto.Encrypt (Exponent));
int first = Modulus.Length / 2;
writer.WriteBytes (crypto.Encrypt (Modulus.Copy (0, first)));
writer.WriteBytes (crypto.Encrypt (Modulus.Copy (first, Modulus.Length - first)));
}
}
示例9: WritePayload
public override void WritePayload(IValueWriter writer)
{
base.WritePayload(writer);
writer.WriteBytes(RegisteredEndPoint.Address.GetAddressBytes());
writer.WriteInt32(RegisteredEndPoint.Port);
}