@Override
  public int write(OutputStream out, boolean withTags) throws IOException {
    int len = getSerializedSize(withTags);
    out.write(this.bytes, this.offset, len);
    return len;
  }
Write out a KeyValue in the manner in which we used to when KeyValue was a Writable.
@param kv  the KeyValue on which write is being requested
@param out OutputStream to write keyValue to
@return Length written on stream
@throws IOException if any IO error happen
@see #create(DataInput) for the inverse function
hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java