diff --git a/src/main/java/com/redhat/trie/Util.java b/src/main/java/com/redhat/trie/Util.java index 57ff054..5e0615c 100644 --- a/src/main/java/com/redhat/trie/Util.java +++ b/src/main/java/com/redhat/trie/Util.java @@ -441,6 +441,20 @@ public class Util { return nodesList.get(0); } + private byte[] byteProcess(List entries) + throws IOException, UnsupportedEncodingException { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + DeflaterOutputStream dos = new DeflaterOutputStream(baos, + new Deflater(Deflater.BEST_COMPRESSION)); + for (String segment : entries) { + dos.write(segment.getBytes("UTF-8")); + dos.write("\0".getBytes("UTF-8")); + } + dos.finish(); + dos.close(); + return baos.toByteArray(); + } + private int findSmallest(int exclude, List nodes) { int smallest = -1; for (int index = 0; index < nodes.size(); index++) {