I want to use a MIME parser to parse a file like the following, which is not an email, nor it is http request body.
The file has one header section, which is in XML format and several sections whose first part is subHeader and second part is binary data.
That is, section immediately after "Content-Location: dataX.bin" is binary data section. The length of this binary data is given inside the XML header ("dataPoints").
Each subHeader section has information specific to the binary data that follow.
Once I parse the XML header part, I know how to extract values from that section.
I want to parse and store the binary data (let's say "data1.bin") into an array for further processing. I am not sure how I will after I get to this point but I want to get to that point first.
(The binary data is encoded in IEEE754 float- 32 bit single precision, I need to convert those bunches to "normal looking numbers"- even though they have 10 to 12 digits and do all sorts of calculation.)
Many samples I read in the internet are for emails.
Google has given me javaMail, mime4j, mimeEntity of IBM/Lotus domino, netscape.messaging.mime.
I am thinking to use mime4j. Or should I use javamail?
There are different types of binary data sections for each subHeader, all properly separated by "--MIME_boundary-2"s, from which I will only need, say "data1.bin", so a blanket reading of all content is not efficient. That's why I want to use a parser and write proper codes (in
Java) that basically grabs what is required to grab.
I will have to read 50-60 files like that, so a faster implementation is ideal.
I found a sample at mozgoweb.com/posts/how-to-parse-mime-message-using-mime4j-library/ but it parses emails only.
I will keep on googling, but with the kind of skill I have, I doubt I will find a right one and understand.
Can someone give some idea, an outline, some code snippets if possible, how I read and get those parts.
Thank you for your time reading and possibly giving some hints.
Cheers!