本文主要是介绍BytesWritable 的copyBytes和getBytes的区别,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
BytesWritable value = new BytesWritable();
BytesWritable不能作为mapreduce中的key或者value,与ByteWritable不同。1,BytesWritable.tobyte()//将ByteWritable类型的数据转换为十六进制对,并以空格分开;2,BytesWritable.set(byte[] newData,int offset,int length);//将值设置为给定的字节范围的副本3,BytesWritable.copyBytes()//获得对象的byte[]类型全部数据:Get a copy of the bytes that is exactly the length of the data. See getBytes() for faster access to the underlying array.4,BytesWritable.getBytes()//**Get the data backing the BytesWritable. Please use copyBytes() if you need the returned array to be precisely the length of the data.**
Modifier and Type | Method and Description |
---|---|
byte[] | copyBytes():Get a copy of the bytes that is exactly the length of the data. |
boolean | equals(Object right_o |
这篇关于BytesWritable 的copyBytes和getBytes的区别的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!