Service:
@Path("/rest/zba")
public class Service {
@GET
@Produces(MediaType.MULTIPART_FORM_DATA)
public @MultipartForm
MyBean get()
}
MyBean:
public class MyBean {
@FormParam("someBinary")
@PartType(MediaType.APPLICATION_OCTET_STREAM)
private InputStream someBinary;
public InputStream getSomeBinary()
{ return someBinary; }public void setSomeBinary(InputStream someBinary)
{ this.someBinary = someBinary; }}
outputs:
--f231sldkxx11
-f231sldkxx11-
if I use byte[] instead of InputStream the output is correct:
--f231sldkxx11
Content-Length: 0
Content-Disposition: form-data; name="someBinary"
Content-Type: application/octet-stream
-f231sldkxx11-