国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

歡迎使用CSDN-markdown編輯器

2019-11-14 12:33:48
字體:
來源:轉載
供稿:網友

hadoop示例代碼

序列化和反序列化 IntWritable writable = new IntWritable(10); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); DataOutputStream dataOutputStream = new DataOutputStream(byteArrayOutputStream); writable.write(dataOutputStream); dataOutputStream.close(); byte[] bytes = byteArrayOutputStream.toByteArray(); System.out.PRintln(StringUtils.byteToHexString(bytes)); //解序列化 ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); DataInputStream input = new DataInputStream(byteArrayInputStream); IntWritable intWritable = new IntWritable(); intWritable.readFields(input); input.close(); System.out.println(intWritable);writable對象的比較 IntWritable int1 = new IntWritable(1); IntWritable int2 = new IntWritable(3); RawComparator<IntWritable> comparator = WritableComparator.get(IntWritable.class); System.out.println(comparator.compare(int1,int2)); //也可以直接比較字節流,不需要反序列化,問題是怎么定位這個字節流呢 System.out.println(comparator.compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2));
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 沙雅县| 肥乡县| 许昌市| 自贡市| 周口市| 昌宁县| 泰来县| 蒙阴县| 咸阳市| 浮梁县| 米易县| 思茅市| 普安县| 定州市| 宜川县| 九龙县| 盖州市| 甘肃省| 巴里| 应城市| 永顺县| 北辰区| 神农架林区| 扎赉特旗| 绥芬河市| 招远市| 剑川县| 武川县| 清徐县| 万荣县| 青浦区| 喀喇| 军事| 波密县| 林州市| 石楼县| 乌拉特后旗| 平利县| 台湾省| 扬中市| 南雄市|