CodePudding user response:
Is there a way to, ah, my friends, urgent urgentCodePudding user response:
First address can type into the write floating-point array need the type of writing memorystream, pay attention to the size, didn't try, you can tryCodePudding user response:
A float array []=...Stream. WriteBuffer (array, sizeof (array));
CodePudding user response:
TMemoryStream * fs=new TMemoryStream ();//to compress the original memory flowTMemoryStream * ms=new TMemoryStream ();//receive the compressed file flow
Fs - & gt; Write (f, 4000);
Fs - & gt; The Position=0;
Int fsize=0;
Fsize=fs - & gt; The Size;//file size
Ms - & gt; WriteBuffer (& amp; Fsize, sizeof (fsize));//set up receiving flow and write to the original file size
Cs=new TZCompressionStream * TZCompressionStream (ms, zcDefault);
Fs - & gt; SaveToStream (cs);//to compress the data
Ms - & gt; SaveToFile (" F: \ \ 1. Zip ");//save
ShowMessage (" finished ");
Delete the fs.
The delete ms;
The delete cs;
I use the above code to Zlib compression, decompression and found is wrong, what's the problem