Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

How to convert Byte[] to custom type.
Pls suggest me.


Subash.
Posted
Comments
Hiren solanki 13-Jan-11 1:05am    
can you please elaborate ?

THIS[^] would help you quick.
 
Share this answer
 
Comments
JF2015 13-Jan-11 1:11am    
Very good answer to this abstruse question.
If this is a primitive type, it's a System.BitConverter: http://msdn.microsoft.com/en-us/library/system.bitconverter.aspx[^]

For user-defined class it can be serialized if different ways. You can convert on per-field basis or use binary serializer.
 
Share this answer
 
Comments
Espen Harlinn 13-Jan-11 8:57am    
5+ It's not a wrong answer, and serialization is a nice simple way to do it. For a high performance solution BitConverter and a cutom serialization implementation is the way to go.
JF2015 14-Jan-11 2:21am    
Good answer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900