Parser for the multipart format
-
12-11-2019 - |
Pregunta
org.apache.http can work with multipart?
I send http request with header Range : bytes=0-500,9000-9999
I get file format:
--00000000000000001873
Content-Type: audio/mpeg
Content-Range: bytes 0-8999/4593415
ID3....bytes....
...bytes®
--00000000000000001873
Content-Type: audio/mpeg
Content-Range: bytes 9000-9999/4593415
ф....bytes...
...bytes
--00000000000000001873--
How to take only the bytes?
Solución
Apache Mime4j
is your friend.
Otros consejos
you need to know the boundary (should be defined in the main response header)
when you see the boundary you can parse the subheader to find out what follows (in this case the content type and -range
note: the boundary is defined to be only found in the headers to delimit them
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow