PC Review


Reply
Thread Tools Rate Thread

how to convert a class/struct to a byte array?

 
 
chrisben
Guest
Posts: n/a
 
      7th Oct 2008
Hi,

Assuming I have a class/struct with only following types
float, int, string

what is the most efficient way to pack it to a single byte array before I
send it out. I tried to use Bitconverter.GetBytes, but not sure what is the
best/quickest way to combine all bytes together.

Thanks

Chris
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
assign byte array to struct or class Christian Havel Microsoft C# .NET 2 10th Mar 2008 11:14 AM
Converting a C# struct to a byte[] array? =?Utf-8?B?TGFnZ2lu?= Microsoft Dot NET Framework 1 19th May 2004 08:18 AM
can I convert an object/struct to raw data (byte array) and back again? Chris LaJoie Microsoft C# .NET 1 3rd Sep 2003 07:07 AM
Convert Struct to byte[] TJO Microsoft C# .NET 2 26th Jul 2003 04:14 PM
How to transform a Struct into a byte array Ignacio Domínguez Microsoft C# .NET 0 13th Jul 2003 04:54 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:41 AM.