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

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

歡迎使用CSDN-markdown編輯器

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

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));
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 平邑县| 昔阳县| 开平市| 雷州市| 大丰市| 岗巴县| 巴彦淖尔市| 西乌珠穆沁旗| 邢台县| 京山县| 宁明县| 崇州市| 拉孜县| 惠水县| 辽宁省| 望城县| 故城县| 腾冲县| 石景山区| 岑溪市| 襄垣县| 土默特左旗| 东乡县| 吐鲁番市| 修文县| 晋宁县| 甘德县| 宁河县| 双江| 同德县| 元阳县| 凤凰县| 泌阳县| 阳高县| 醴陵市| 河池市| 锡林浩特市| 如皋市| 南昌市| 正宁县| 晋中市|