simple binary read/write question
Posted on 2004-08-13
I have an mp3 file. I want to open it, then read in every byte into an array. Then using that storage array, I would like to write it back out to a new mp3 file.
Can I use c++'s ifstream class to simply get() a char at a time from the mp3 file, store it in a char array, then write it back out to the new file using put() for each element?
I am uncertain if this method will only work for a text document. If so, what can I use to accomplish this feat for a binary file, if an mp3 file indeed is one.
I am restrained to keeping the data alive in a buffer array and writing the copied file out in that manner.
Thanks for your time