码迷,mamicode.com
首页 > 其他好文 > 详细

BytesWritable 存储问题

时间:2014-05-13 23:17:47      阅读:333      评论:0      收藏:0      [点我收藏+]

标签:blog   class   code   java   c   int   

	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 存储问题

标签:blog   class   code   java   c   int   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!