Skip to content

Commit 61047a5

Browse files
Teagan42seldondev
authored andcommitted
Use ByteString
1 parent 2d89b97 commit 61047a5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

engine/src/main/java/io/seldon/engine/api/rest/RestClientController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package io.seldon.engine.api.rest;
1717

1818
import com.fasterxml.jackson.databind.ObjectMapper;
19+
import com.google.protobuf.ByteString;
1920
import com.google.protobuf.InvalidProtocolBufferException;
2021
import io.micrometer.core.annotation.Timed;
2122
import io.opentracing.Span;
@@ -175,7 +176,7 @@ public ResponseEntity<String> predictions_binary(RequestEntity<InputStream> requ
175176
try {
176177
ObjectMapper mapper = new ObjectMapper();
177178
Map<String, Object> protoBody = new HashMap<String, Object>() {{
178-
put("binData", toByteArray(requestEntity.getBody()));
179+
put("binData", ByteString.copyFrom(toByteArray(requestEntity.getBody())));
179180
}};
180181
return _predictions(mapper.writeValueAsString(protoBody));
181182
} catch (IOException e) {

0 commit comments

Comments
 (0)