diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-08-30 20:54:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-30 20:54:26 +0200 |
commit | 2c08131faa2a3df78a47f4cdabd2ff7791d15c0c (patch) | |
tree | f7f31ba59b708ee9c93a48629f3d1f24a32a886f /vespajlib/src/main/java/com/yahoo/slime/BinaryFormat.java | |
parent | 193dc7fa8cf4b4d5c8ca9cb1a1836821e2069d87 (diff) | |
parent | 26b09e283a21d3e123f63db041d16e2eae0a54e0 (diff) |
Merge pull request #18905 from vespa-engine/revert-18903-balder/avoid-copying-data
Revert "Avoid copying data just to compress them when it is not necessary."
Diffstat (limited to 'vespajlib/src/main/java/com/yahoo/slime/BinaryFormat.java')
-rw-r--r-- | vespajlib/src/main/java/com/yahoo/slime/BinaryFormat.java | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/slime/BinaryFormat.java b/vespajlib/src/main/java/com/yahoo/slime/BinaryFormat.java index b6cde18f824..c212500eca7 100644 --- a/vespajlib/src/main/java/com/yahoo/slime/BinaryFormat.java +++ b/vespajlib/src/main/java/com/yahoo/slime/BinaryFormat.java @@ -1,8 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.slime; -import com.yahoo.compress.Compressor; - /** * Class for serializing Slime data into binary format, or deserializing * the binary format into a Slime object. @@ -42,17 +40,8 @@ public class BinaryFormat { * @return a new byte array with just the encoded slime. **/ public static byte[] encode(Slime slime) { - return new BinaryEncoder().encode(slime).toArray(); - } - - /** - * Take a Slime object and serialize it into binary format, and compresses it. - * @param slime the object which is to be serialized. - * @param compressor the compressor to use. - * @return a new byte array with just the encoded and compressed slime. - **/ - public static Compressor.Compression encode_and_compress(Slime slime, Compressor compressor) { - return new BinaryEncoder().encode(slime).compress(compressor); + BinaryEncoder encoder = new BinaryEncoder(); + return encoder.encode(slime); } /** |