Code example for ShortBuffer

Methods: positionput

0
		// vertices with 2. 
		ByteBuffer indiceBiteBuffer = ByteBuffer
				.allocateDirect(source.length * 2);
		indiceBiteBuffer.order(ByteOrder.nativeOrder());
		ShortBuffer targetBuffer = indiceBiteBuffer.asShortBuffer();
		targetBuffer.put(source);
		targetBuffer.position(0);
		return targetBuffer;
	} 
 
	/** 
	 * this is a copy from 
	 * {@link SensorManager#getRotationMatrixFromVector(float[] R, float[] rotationVector)} 
	 * in newer android versions. Code from: 
	 * http://android.git.kernel.org/?p=platform/frameworks/base 
	 * .git;a=blob;f=core/java/android/hardware/SensorManager.java to keep 
	 * compatibility to older Android versions 
	 *  
	 * TODO the "if lenght==3" stuff could be removed? 
	 *  
Contextual code suggestions in your IDE  Get Codota for Java