public void compressTags(OutputStream out, byte[] in, int offset, int length) throws IOException {
    int pos = offset;
    int endOffset = pos + length;
    assert pos < endOffset;
    while (pos < endOffset) {
      int tagLen = Bytes.readAsInt(in, pos, Tag.TAG_LENGTH_SIZE);
      pos += Tag.TAG_LENGTH_SIZE;
      Dictionary.write(out, in, pos, tagLen, tagDict);
      pos += tagLen;
    }
  }
Compress tags one by one and writes to the OutputStream.
@param out    Stream to which the compressed tags to be written
@param in     Source where tags are available
@param offset Offset for the tags bytes
@param length Length of all tag bytes
hbase-common/src/main/java/org/apache/hadoop/hbase/io/TagCompressionContext.java