Parser for the multipart format
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-开发者_如何学PythonRange: 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?
Apache Mime4j
is your friend.
http://james.apache.org/mime4j/index.html
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
精彩评论