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

首頁 > 學(xué)院 > 開發(fā)設(shè)計 > 正文

歡迎使用CSDN-markdown編輯器

2019-11-14 13:08:06
字體:
供稿:網(wǎng)友

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)); //也可以直接比較字節(jié)流,不需要反序列化,問題是怎么定位這個字節(jié)流呢 System.out.println(comparator.compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2));
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 屏东市| 长顺县| 龙胜| 东乡族自治县| 莆田市| 和政县| 滦平县| 宁远县| 澎湖县| 来凤县| 泸州市| 巴塘县| 澜沧| 尼勒克县| 林口县| 油尖旺区| 凤翔县| 郸城县| 临猗县| 拉孜县| 永泰县| 城口县| 贡山| 佳木斯市| 九寨沟县| 昭苏县| 同仁县| 乐东| 罗甸县| 扶风县| 广水市| 黑山县| 泽州县| 崇文区| 雅安市| 金川县| 永德县| 雅安市| 涿州市| 巨野县| 大冶市|