diff options
Diffstat (limited to 'vespajlib/src/main/java/com/yahoo/slime/BufferedOutput.java')
-rw-r--r-- | vespajlib/src/main/java/com/yahoo/slime/BufferedOutput.java | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/slime/BufferedOutput.java b/vespajlib/src/main/java/com/yahoo/slime/BufferedOutput.java index 61a00185e76..20ed0fc8018 100644 --- a/vespajlib/src/main/java/com/yahoo/slime/BufferedOutput.java +++ b/vespajlib/src/main/java/com/yahoo/slime/BufferedOutput.java @@ -1,24 +1,22 @@ // 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 BufferedOutput { +final class BufferedOutput { private byte[] buf; private int capacity; private int pos; - BufferedOutput(int cap) { + public BufferedOutput(int cap) { capacity = (cap < 64) ? 64 : cap; buf = new byte[capacity]; } - BufferedOutput() { + public BufferedOutput() { this(4096); } - void reset() { + public void reset() { pos = 0; } @@ -33,7 +31,7 @@ class BufferedOutput { } } - int position() { return pos; } + public int position() { return pos; } void put(byte b) { reserve(1); @@ -51,12 +49,9 @@ class BufferedOutput { } } - byte[] toArray() { + public byte[] toArray() { byte[] ret = new byte[pos]; System.arraycopy(buf, 0, ret, 0, pos); return ret; } - Compressor.Compression compress(Compressor compressor) { - return compressor.compress(buf, pos); - } } |