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

首頁(yè) > 學(xué)院 > 開(kāi)發(fā)設(shè)計(jì) > 正文

歡迎使用CSDN-markdown編輯器

2019-11-14 12:36:06
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(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對(duì)象的比較 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é)流,不需要反序列化,問(wèn)題是怎么定位這個(gè)字節(jié)流呢 System.out.println(comparator.compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2));
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 文昌市| 海林市| 沭阳县| 石楼县| 卫辉市| 新巴尔虎左旗| 科尔| 县级市| 泸溪县| 盐津县| 吐鲁番市| 东山县| 贞丰县| 洛南县| 巴里| 上高县| 仲巴县| 旅游| 新河县| 天水市| 呼伦贝尔市| 澳门| 星座| 鄢陵县| 浙江省| 乐山市| 蓬莱市| 读书| 涞源县| 开原市| 宁化县| 枣强县| 佛坪县| 南充市| 即墨市| 油尖旺区| 县级市| 南宁市| 延庆县| 禄丰县| 涿州市|