On Aug 7, 8:14 am, elet.mir...@gmail.com wrote:
> On Aug 6, 7:55 pm, HumbleWorker <amardeep.develo...@gmail.com> wrote:
>
>
>
>
>
> > On Aug 7, 6:48 am, elet.mir...@gmail.com wrote:
>
> > > Hi everyone,
>
> > > I am currently using Visual C++ 8 Standard.
>
> > > I have a quite large data array (1GB) in the form of an unsigned char
> > > array.
> > > I need to save this to disk in 16-bit format (two chars form a 16-bit
> > > value) or 32-bit format (half of 32 bit value empty).
>
> > > I was wondering what class I should use to save this data as fast as
> > > possible.
> > > Saving it as bytes is not best, as unfortunately the reading program
> > > (Matlab) will have to convert this to 16-bit, and this will take quite
> > > long.
>
> > > What matters is for this data to end up on disk as fast as possible in
> > > 16-bit or 32-bit format.
>
> > > Any help would be greatly appreciated!
>
> > > Thank you,
> > > Best regards,
> > > Tele
>
> > Use ofstream class.
>
> Any particular reason why I should use ofstream?
> As opposed for example to binarywriter or other.
>
> Regards,
> Tele- Hide quoted text -
>
> - Show quoted text -
BinaryWriters are .NET classes, and they are wrappers around the
streams only. They may not be specifically wrapping around Standard C+
+ streams, but they definitely wrap around something conceptually
similar. If you set the constant ios::binary in the constructor for
fstream, you get a binary writer.
if you can send me your code i can revert back with a complete code.
Thanks.
HW