How do I save a class's Raw Data (without .NET object data) to a binary file?
- From: mpreisdorf@xxxxxxxxx
- Date: 27 Jun 2006 07:59:05 -0700
I want to save the raw data of a class (without the .NET object
overhead) to a binary file. For example:
ref class Test
{
public:
String^ name;
Int32 number;
.....
}
I want to save the raw characters of the string and the raw integer
without the additional .NET Object data. I am trying to create an
array of Bytes and cast that array as my class, but the casting fails.
I was then going to write the Array out using a BinaryFormater object,
but I first need to cast the array as my class so I can easily stuff
the array. Can anyone help by providing an example of casting an array
of Bytes to a managed class, or of writing the actual raw data of a
class to a file?
.
- Follow-Ups:
- Re: How do I save a class's Raw Data (without .NET object data) to a binary file?
- From: Ben Voigt
- Re: How do I save a class's Raw Data (without .NET object data) to a binary file?
- From: William DePalo [MVP VC++]
- Re: How do I save a class's Raw Data (without .NET object data) to a binary file?
- Prev by Date: linking errors in 2005 only with /MT option, nothing else
- Next by Date: Re: How do I save a class's Raw Data (without .NET object data) to a binary file?
- Previous by thread: linking errors in 2005 only with /MT option, nothing else
- Next by thread: Re: How do I save a class's Raw Data (without .NET object data) to a binary file?
- Index(es):
Relevant Pages
|