public static void main(String[] args) {
		ByteBuffer buffer = ByteBuffer.allocate(10);
		//buffer.limit(7);
		System.out.println(buffer.limit() + "." + buffer.position());
		
		//init data
		for(int i=0;i<buffer.capacity();i++){
			buffer.put((byte) i);
			System.out.println(buffer.limit() + "." + buffer.position());
		}
		
		System.out.println(buffer.limit() + "." + buffer.position());
		
		while(buffer.remaining() > 0){
			System.out.println(buffer.get());
		}
		
		buffer.position(3);
		buffer.limit(7);
		
		//slice
		ByteBuffer slice = buffer.slice();
		for(int i=0;i<slice.capacity();i++){
			byte b = slice.get(i);
			b*=11;
			slice.put(i,b);
		}
		
		//buffer.position(0);
		//buffer.limit(buffer.capacity());
		while(buffer.remaining() > 0){
			System.out.println(buffer.get());
		}
	}