Convert an array of byte into other types
-
-
Hi all, I just found the method to convert to Integer types like Int16, Int32, Int64 by Marshal class: Use the Copy method to copy the data in Byte() into an IntPtr pointer, after that copy the pointer into an integer variable by the ReadInt32 method. But the problem still exists: the Marshal class does not have any method to copy a pointer into a Single or Double variable. Anyone have suggestion?
-
Hi all, I just found the method to convert to Integer types like Int16, Int32, Int64 by Marshal class: Use the Copy method to copy the data in Byte() into an IntPtr pointer, after that copy the pointer into an integer variable by the ReadInt32 method. But the problem still exists: the Marshal class does not have any method to copy a pointer into a Single or Double variable. Anyone have suggestion?
The .NET Framework has beaten you to this little project. Check out the BitConverter[^] class. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
The .NET Framework has beaten you to this little project. Check out the BitConverter[^] class. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
Thank you, The BitConverter class meets most of my needs, except the String type :)
-
Thank you, The BitConverter class meets most of my needs, except the String type :)
StringBuilder[^] class RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome