public static Writable copyWritable(final byte[] bytes, final Writable tgt) throws IOException {
    DataInputStream dis = new DataInputStream(new ByteArrayInputStream(bytes));
    try {
      tgt.readFields(dis);
    } finally {
      dis.close();
    }
    return tgt;
  }
Copy one Writable to another. Copies bytes using data streams.
@param bytes Source Writable
@param tgt   Target Writable
@return The target Writable.
@throws IOException e
hbase-client/src/main/java/org/apache/hadoop/hbase/util/Writables.java