首页 > 其他 > 详细

BytesWritable 存储问题

时间:2014-05-13 23:17:18      阅读:408      评论:0      收藏:0      [点我收藏+]
	public static void main(String args[]){
		BytesWritable cv = new BytesWritable();
		String str1 = "1234567";
		String str2 = "123450";
		cv.set(str1.getBytes(), 0, str1.getBytes().length);
		System.out.println(new String(cv.getBytes()));
		
		cv.set(str2.getBytes(), 0, str2.getBytes().length);
		System.out.println(new String(cv.getBytes()));
	}
output:
1234567
1234507
	public static void main(String args[]){
		BytesWritable cv = new BytesWritable();
		String str1 = "1234567";
		String str2 = "123450";
		cv.set(str1.getBytes(), 0, str1.getBytes().length);
		System.out.println(new String(cv.getBytes()));
		
		cv.setCapacity(0);
		
		cv.set(str2.getBytes(), 0, str2.getBytes().length);
		System.out.println(new String(cv.getBytes()));
	}
output:
1234567
123450




BytesWritable 存储问题,布布扣,bubuko.com

BytesWritable 存储问题

原文:http://blog.csdn.net/xiewenbo/article/details/25632363

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!