Exemplo n.º 1
0
		public static void Serialize (Stream stream, RequestCustomHash instance)
		{
			if (instance.CustomID == null)
				throw new ArgumentNullException ("CustomID", "Required by proto specification.");
			ProtocolParser.WriteKey (stream, new ProtocolBuffers.Key (1, Wire.LengthDelimited));
			ProtocolParser.WriteBytes (stream, instance.CustomID);
		}
Exemplo n.º 2
0
		public static byte[] SerializeToBytes (RequestCustomHash instance)
		{
			using (MemoryStream ms = new MemoryStream()) {
				Serialize (ms, instance);
				return ms.ToArray ();
			}
		}
Exemplo n.º 3
0
		public static RequestCustomHash Deserialize (Stream stream)
		{
			RequestCustomHash instance = new RequestCustomHash ();
			Deserialize (stream, instance);
			return instance;
		}