bytes = compress(data, compressingStreamClass);
}
MediaType type =
encoding == null ? MediaType.TEXT_PLAIN_TYPE : new MediaType("application", encoding);
InputStream in = new ByteArrayInputStream(bytes);
StreamDataBodyPart filePart = new StreamDataBodyPart("data", in, "data", type);
MultiPart multiPart = new MultiPart(MediaType.MULTIPART_FORM_DATA_TYPE);
multiPart.getBodyParts().add(filePart);
Response response = target("/ingest").request().post(
Entity.entity(multiPart, MediaType.MULTIPART_FORM_DATA_TYPE));
checkResponse(response);