Skip to content

Commit

Permalink
Use ByteString
Browse files Browse the repository at this point in the history
  • Loading branch information
Teagan42 authored and seldondev committed Apr 2, 2020
1 parent 2d89b97 commit 61047a5
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package io.seldon.engine.api.rest;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.protobuf.ByteString;
import com.google.protobuf.InvalidProtocolBufferException;
import io.micrometer.core.annotation.Timed;
import io.opentracing.Span;
Expand Down Expand Up @@ -175,7 +176,7 @@ public ResponseEntity<String> predictions_binary(RequestEntity<InputStream> requ
try {
ObjectMapper mapper = new ObjectMapper();
Map<String, Object> protoBody = new HashMap<String, Object>() {{
put("binData", toByteArray(requestEntity.getBody()));
put("binData", ByteString.copyFrom(toByteArray(requestEntity.getBody())));
}};
return _predictions(mapper.writeValueAsString(protoBody));
} catch (IOException e) {
Expand Down

0 comments on commit 61047a5

Please sign in to comment.