[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

How to insert binary data into a file?

Asked by yong615 in Education Industry, Emacs, Networking Protocols

Tags: c++ byte binary file io insert binary data

I want to read a file (any kind) and I want to insert 3 byte header in every 1400 byte.
1. read file size and print files size
2. insert 3 byte header into every 1400 byte
  something like:
|---3 byte header -- | --- 1400 byte of data --- | --- 3byte header --- |  --- 1400 byte of data --- |
3. write that on new binary file

The problem that I have is that I can read 1400 byte of data into memory but I cannot append the first 1400 byte data after the 3 byte header and I cannot do the second block and so on. How can I make loop to complete it and write in a new binary file? Please help me...
[+][-]11/28/08 04:40 PM, ID: 23058033Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/28/08 05:35 PM, ID: 23058122Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/30/08 09:55 AM, ID: 23064039Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/30/08 08:39 PM, ID: 23066224Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/30/08 08:42 PM, ID: 23066234Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 - Hierarchy / EE_QW_3_20080625