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?

¿Fue útil?

Solución

Apache Mime4j is your friend.

http://james.apache.org/mime4j/index.html

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
scroll top