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

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

歡迎使用CSDN-markdown編輯器

2019-11-14 12:33:29
字體:
來(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ā)表
主站蜘蛛池模板: 库尔勒市| 蚌埠市| 保亭| 新源县| 寿宁县| 西峡县| 象山县| 甘泉县| 台山市| 安陆市| 营口市| 讷河市| 宜君县| 呼伦贝尔市| 融水| 青田县| 光泽县| 平潭县| 菏泽市| 乳山市| 泗阳县| 岳阳市| 明光市| 通渭县| 临海市| 长武县| 曲阳县| 梅州市| 河东区| 瑞安市| 镇江市| 景德镇市| 富宁县| 秀山| 天等县| 永吉县| 蓬溪县| 新竹市| 永安市| 芜湖市| 孟津县|