petbo
05-13-2004, 01:16 AM
Hi all,
How do I turn a binary file (>500kb) into 1024byte chunks? I know how to open the file and get it into a byte array, but I'm stuck from there...
Thanks,
Peter
Iceplug
05-13-2004, 07:18 AM
Where will these chunks be? 500 separate files?
You could declare a byte array with 1024 elements 0 to 1023
and then use BR.ReadBytes() to read in 1024 bytes. :)
petbo
05-14-2004, 12:46 PM
Where will these chunks be? 500 separate files?
You could declare a byte array with 1024 elements 0 to 1023
and then use BR.ReadBytes() to read in 1024 bytes. :)
Hmm... I'm not sure if this is exactly what i'm looking for. Basically I want to chop up one big file into small chunks, and then send each chunk over the network via winsock. The chunks are then re-assemballed at the other end... I know this is possible - but how! :confused:
Thanks a lot for your help though... But anyone got an idea?
Iceplug
05-14-2004, 10:04 PM
Try ReadChars()
that'll read in some number of characters from the file into a character array... then you can probably pass this array through the Winsock (you can use Sockets namespace as well).