Exemplo n.º 1
0
 public void Serialize(NetworkOrderBinaryWriter writer)
 {
     foreach (IBinaryWritable element in this)
     {
         element.Serialize(writer);
     }
 }
Exemplo n.º 2
0
        public void Serialize(NetworkOrderBinaryWriter writer)
        {
            using (MemoryStream tempBuffer = new MemoryStream())
            {
                NetworkOrderBinaryWriter tempWriter = new NetworkOrderBinaryWriter(tempBuffer);

                m_dataSource.Serialize(tempWriter);

                // Read the stream, compute CRC, and add 4 bytes
                // We do nothing for now.
                tempWriter.Write((byte)0);
                tempWriter.Write((byte)0);
                tempWriter.Write((byte)0);
                tempWriter.Write((byte)0);

                writer.BaseStream.Write(tempBuffer.GetBuffer(), 0, (int)tempBuffer.Length);
            }
        }