public override void WritePayload(IValueWriter writer) { base.WritePayload(writer); writer.WriteBytes(InternalPeerEndPoint.Address.GetAddressBytes()); writer.WriteInt32(InternalPeerEndPoint.Port); writer.WriteBytes(ExternalPeerEndPoint.Address.GetAddressBytes()); writer.WriteInt32(ExternalPeerEndPoint.Port); }
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); }
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))); }
public override void WritePayload(ISerializationContext context, IValueWriter writer) { using (var ms = new MemoryStream()) { ScreenFrame.Save(ms, ImageFormat.Png); writer.WriteBytes(ms.GetBuffer()); } }
public void Serialize(ISerializationContext context, IValueWriter writer, RSAParameters element) { writer.WriteBytes(element.D); writer.WriteBytes(element.DP); writer.WriteBytes(element.DQ); writer.WriteBytes(element.Exponent); writer.WriteBytes(element.InverseQ); writer.WriteBytes(element.Modulus); writer.WriteBytes(element.P); writer.WriteBytes(element.Q); }
public void Serialize(ISerializationContext context, IValueWriter writer) { if (!writer.WriteBool(this.publicKey != null)) { return; } writer.WriteBytes(this.publicKey); writer.WriteInt32(this.exponentOffset); }
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]); } }
private void SerializableSerializer(IValueWriter writer, object value) { if (this.type.IsClass) { writer.WriteBool(value == null); } using (MemoryStream stream = new MemoryStream()) { new BinaryFormatter().Serialize(stream, value); writer.WriteBytes(stream.ToArray()); } }
public void ReadWriteBytesSubset() { IValueWriter writer = GetWriter(); byte[] data = new byte[] { 0x4, 0x8, 0xF, 0x10, 0x17, 0x2A }; writer.WriteBytes(data, 2, 3); writer.Flush(); data = GetReader(writer).ReadBytes(); Assert.AreEqual(3, data.Length); Assert.AreEqual(0xF, data[0]); Assert.AreEqual(0x10, data[1]); Assert.AreEqual(0x17, data[2]); }
public override void WritePayload(ISerializationContext context, IValueWriter writer) { writer.WriteByte((byte)TargetType); writer.WriteUInt16((ushort)TargetIds.Length); for (int i = 0; i < TargetIds.Length; ++i) { writer.WriteInt32(TargetIds[i]); } writer.WriteInt32(Sequence); writer.WriteInt32(SourceId); writer.WriteByte((byte)Data.Length); for (int i = 0; i < Data.Length; ++i) { writer.WriteBytes(Data[i]); } }
public void Serialize(ISerializationContext context, IValueWriter writer) { if (!writer.WriteBool (this.publicKey != null)) return; writer.WriteBytes (this.publicKey); writer.WriteInt32 (this.exponentOffset); }
public override void WritePayload(IValueWriter writer) { base.WritePayload(writer); writer.WriteBytes(RegisteredEndPoint.Address.GetAddressBytes()); writer.WriteInt32(RegisteredEndPoint.Port); }
public void Serialize(ISerializationContext context, IValueWriter writer) { if (writer.WriteBool (D != null)) { writer.WriteBytes (D); writer.WriteBytes (DP); writer.WriteBytes (DQ); writer.WriteBytes (InverseQ); writer.WriteBytes (P); writer.WriteBytes (Q); } if (writer.WriteBool (this.publicKey != null)) { writer.WriteBytes (this.publicKey); writer.WriteInt32 (this.exponentOffset); } }
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))); } }
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))); }
public override void WritePayload(ISerializationContext context, IValueWriter writer) { writer.WriteBytes (AESKey); writer.WriteString (PublicAuthenticationKeyType.GetSimpleName()); writer.WriteBytes (PublicAuthenticationKey); }
public override void WritePayload(ISerializationContext context, IValueWriter writer) { writer.WriteBytes(AESKey); writer.WriteString(PublicAuthenticationKeyType.GetSimplestName()); writer.WriteBytes(PublicAuthenticationKey); }
public void Serialize(IValueWriter writer, RSACrypto crypto) { if (!writer.WriteBool (this.publicKey != null)) return; writer.WriteBytes (crypto.Encrypt (this.Exponent)); int first = this.Modulus.Length / 2; writer.WriteBytes (crypto.Encrypt (this.Modulus.Copy (0, first))); writer.WriteBytes (crypto.Encrypt (this.Modulus.Copy (first, this.Modulus.Length - first))); }
public override void WritePayload(ISerializationContext context, IValueWriter writer) { writer.WriteUInt16(OriginalMessageId); writer.WriteByte(Count); writer.WriteBytes(Payload, this.offset, this.length); }
public override void WritePayload(ISerializationContext context, IValueWriter writer) { writer.WriteUInt16 (OriginalMessageId); writer.WriteByte (Count); writer.WriteBytes (Payload, this.offset, this.length); }
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]); }