Writables.java 文件源码

java
阅读 18 收藏 0 点赞 0 评论 0

项目:ditb 作者:
/**
 * 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
 */
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;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号