Code example for DoubleBuffer

Methods: limit, position, put

0
		DoubleBuffer buffer = null;
		if(dst instanceof ByteBuffer) buffer = ((ByteBuffer)dst).asDoubleBuffer();
		else if(dst instanceof DoubleBuffer) buffer = (DoubleBuffer)dst;
		if(buffer == null) throw new GdxRuntimeException("dst must be a ByteBuffer or DoubleBuffer");
		 
		int oldPosition = buffer.position();
		buffer.put(src, srcOffset, numElements);
		buffer.position(oldPosition);
		buffer.limit(oldPosition + numElements);
	} 
 
//	/** Copies the contents of src to dst, starting from the current position of src, copying numElements elements (using the data 
//	 * type of src, no matter the datatype of dst). The dst {@link Buffer#position()} is used as the writing offset. The position 
//	 * of both Buffers will stay the same. The limit of the src Buffer will stay the same. The limit of the dst Buffer will be set 
//	 * to dst.position() + numElements, where numElements are translated to the number of elements appropriate for the dst Buffer 
//	 * data type. <b>The Buffers must be direct Buffers with native byte order. No error checking is performed</b>. 
//	 *  
//	 * @param src the source Buffer. 
//	 * @param dst the destination Buffer. 
//	 * @param numElements the number of elements to copy. */ 
//	public static void copy (Buffer src, Buffer dst, int numElements) {