Leon,
Serialization has a very specific meaning in .NET, and is different from
what you are trying to do (which was answered in your next post). The
process of serialization in .NET will write a value, but also write type
information as well into the serialization stream, such that predicting the
size of the outcome is tedious, at best. Also, it is not guaranteed that
you will have the same layout in the serialized form as you do in memory.
If you want to truly serialize the contents of the uint into a byte
array, then you would use a BinaryFormatter instance to serialize to a
MemoryStream.
However, what you want to do is use the BitConverter class, as pointed
out in the answers to your next post.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Leon_Amirreza" <am**************@yahoo.comwrote in message
news:uG*************@TK2MSFTNGP06.phx.gbl...
How can I serialize a uint Type into a Byte[4]?