text: public byte[] Serialize(){int size = DataSize + 4;using (MemoryStream baos = new MemoryStream(size)){Serialize(new LittleEndianOutputStream(baos));if (baos.Length != size){throw new Exception("write size mismatch");}return baos.ToArray();}}