/**
* 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;
}
Writables.java 文件源码
java
阅读 18
收藏 0
点赞 0
评论 0
项目:ditb
作者:
评论列表
文章目录