diff options
Diffstat (limited to 'vespajlib')
-rw-r--r-- | vespajlib/src/main/java/com/yahoo/tensor/serialization/TypedBinaryFormat.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/tensor/serialization/TypedBinaryFormat.java b/vespajlib/src/main/java/com/yahoo/tensor/serialization/TypedBinaryFormat.java index a08e09765c8..951c23310dc 100644 --- a/vespajlib/src/main/java/com/yahoo/tensor/serialization/TypedBinaryFormat.java +++ b/vespajlib/src/main/java/com/yahoo/tensor/serialization/TypedBinaryFormat.java @@ -33,9 +33,13 @@ public class TypedBinaryFormat { public static byte[] encode(Tensor tensor) { GrowableByteBuffer buffer = new GrowableByteBuffer(); + encode(tensor, buffer); + return asByteArray(buffer); + } + public static GrowableByteBuffer encode(Tensor tensor, GrowableByteBuffer buffer) { BinaryFormat encoder = getFormatEncoder(buffer, tensor); encoder.encode(buffer, tensor); - return asByteArray(buffer); + return buffer; } /** |