I want to know what would be an efficient way of do it. I haven't written any code yet, i just have a couple of ideas. Here they go both (just an idea about how code would look like):
1.
To write entire buffer in one step like:
2.Code:fwrite ( buffer , 1 , totalBufferSize , filePointer );
To divide buffer into smaller parts, of 1024 bytes each.
This, requires to copy 1024 bytes from original buffer to a temporal one, and then
copy it to the image like:
Here i'm not counting on not all packages will have a regular size of 1024 bytes, the lastCode:int i; int copyStartPosition; /* Position of original buffer where copy begins */ for ( i = 0 ; i < 1024 ; i++ ) { tmpBuffer[i] = originalBuffer[i+copyStartPosition]; } fwrite ( tmpBuffer , 1 , 1024 , filePointer );
one could not have it.
Am i in the right way to solve this problem?



LinkBack URL
About LinkBacks




.