thanks... yes that's how it could work but that way i have to write the file twice.

what i want to do is to
1. write the file
2. encode the file
3. add the header (not encoded)

the file can be realy large... so i have to modify it. i've used the filestream object and when i debug the program it seems to do what i want... but when i look into the file there's no header