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