/// <summary> /// Restore the contents of a user type instance by reading its state /// using the specified <see cref="IPofReader"/> object. /// </summary> /// <param name="reader"> /// The <b>IPofReader</b> from which to read the object's state. /// </param> /// <exception cref="IOException"> /// If an I/O error occurs. /// </exception> public override void ReadExternal(IPofReader reader) { base.ReadExternal(reader); ChannelId = reader.ReadInt32(1); IdentityToken = reader.ReadByteArray(2); }
/// <summary> /// Restore the contents of a user type instance by reading its state /// using the specified <see cref="IPofReader"/> object. /// </summary> /// <param name="reader"> /// The <b>IPofReader</b> from which to read the object's state. /// </param> /// <exception cref="IOException"> /// If an I/O error occurs. /// </exception> public override void ReadExternal(IPofReader reader) { base.ReadExternal(reader); ProtocolName = reader.ReadString(1); ReceiverName = reader.ReadString(2); IdentityToken = reader.ReadByteArray(3); }
public void TestByteArray() { IPofReader pofReader = initPofReader("ByteArray"); Byte[] res = pofReader.ReadByteArray(0); Assert.AreEqual(1, res[0]); Assert.AreEqual(101, res[1]); Assert.AreEqual(255, res[2]); //Assert.AreEqual(-100, res[3]); }
/// <summary> /// Restore the contents of a user type instance by reading /// its state using the specified <see cref="IPofReader"/> /// object. /// </summary> /// <param name="reader"> /// The <b>IPofReader</b> from which to read the object's /// state. /// </param> /// <exception cref="IOException"> /// If an I/O error occurs. /// </exception> public override void ReadExternal(IPofReader reader) { base.ReadExternal(reader); ClientId = (UUID)reader.ReadObject(1); Edition = reader.ReadInt32(2); ProtocolVersionMap = reader.ReadDictionary(3, new HashDictionary()); IdentityToken = reader.ReadByteArray(4); Member = (IMember)reader.ReadObject(5); ClusterName = reader.ReadString(6); ServiceName = reader.ReadString(7); }