public byte[] compress(byte[] valueArray, int valueOffset, int valueLength) throws IOException {
      if (compressedOut == null) {
        // Create the output streams here the first time around.
        lowerOut = new ByteArrayOutputStream();
        if (compressor == null) {
          compressor = algorithm.getCompressor();
        }
        compressedOut = algorithm.createCompressionStream(lowerOut, compressor, IO_BUFFER_SIZE);
      }
      compressedOut.write(valueArray, valueOffset, valueLength);
      compressedOut.flush();
      final byte[] compressed = lowerOut.toByteArray();
      lowerOut.reset(); // Reset now to minimize the overhead of keeping around the BAOS
      return compressed;
    }
Encapsulates the compression algorithm and its streams that we will use for value compression
in this WAL.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/CompressionContext.java