Code example for FloatBuffer

Methods: limitpositionisDirect

0
		BufferChecks.checkBufferSize(buf, size);
		return wrapNoCopyDirect(buf);
	} 
 
	public static FloatBuffer wrapNoCopyBuffer(FloatBuffer buf, int size) {
		BufferChecks.checkBufferSize(buf, size);
		return wrapNoCopyDirect(buf);
	} 
 
	public static DoubleBuffer wrapNoCopyBuffer(DoubleBuffer buf, int size) {
		BufferChecks.checkBufferSize(buf, size);
		return wrapNoCopyDirect(buf);
	} 
 
	public static ByteBuffer wrapBuffer(ByteBuffer buf, int size) {
		BufferChecks.checkBufferSize(buf, size);
		return wrapDirect(buf);
	} 
 
	public static ShortBuffer wrapBuffer(ShortBuffer buf, int size) {
		BufferChecks.checkBufferSize(buf, size);
		return wrapDirect(buf);
	} 
 
	public static IntBuffer wrapBuffer(IntBuffer buf, int size) {
		BufferChecks.checkBufferSize(buf, size);
		return wrapDirect(buf);
	} 
 
	public static LongBuffer wrapBuffer(LongBuffer buf, int size) {
		BufferChecks.checkBufferSize(buf, size);
		return wrapDirect(buf);
	} 
 
	public static FloatBuffer wrapBuffer(FloatBuffer buf, int size) {
		BufferChecks.checkBufferSize(buf, size);
		return wrapDirect(buf);
	} 
 
	public static DoubleBuffer wrapBuffer(DoubleBuffer buf, int size) {
		BufferChecks.checkBufferSize(buf, size);
		return wrapDirect(buf);
	} 
 
	public static ByteBuffer wrapDirect(ByteBuffer buffer) {
		if (!buffer.isDirect())
			return doWrap(buffer);
		return buffer;
	} 
 
	public static ShortBuffer wrapDirect(ShortBuffer buffer) {
		if (!buffer.isDirect())
			return doWrap(buffer);
		return buffer;
	} 
 
	public static FloatBuffer wrapDirect(FloatBuffer buffer) {
		if (!buffer.isDirect())
			return doWrap(buffer);
		return buffer;
	} 
 
	public static IntBuffer wrapDirect(IntBuffer buffer) {
		if (!buffer.isDirect())
			return doWrap(buffer);
		return buffer;
	} 
 
	public static LongBuffer wrapDirect(LongBuffer buffer) {
		if (!buffer.isDirect())
			return doWrap(buffer);
		return buffer;
	} 
 
	public static DoubleBuffer wrapDirect(DoubleBuffer buffer) {
		if (!buffer.isDirect())
			return doWrap(buffer);
		return buffer;
	} 
 
	public static ByteBuffer wrapNoCopyDirect(ByteBuffer buffer) {
		if (!buffer.isDirect())
			return doNoCopyWrap(buffer);
		return buffer;
	} 
 
	public static ShortBuffer wrapNoCopyDirect(ShortBuffer buffer) {
		if (!buffer.isDirect())
			return doNoCopyWrap(buffer);
		return buffer;
	} 
 
	public static FloatBuffer wrapNoCopyDirect(FloatBuffer buffer) {
		if (!buffer.isDirect())
			return doNoCopyWrap(buffer);
		return buffer;
	} 
 
	public static IntBuffer wrapNoCopyDirect(IntBuffer buffer) {
		if (!buffer.isDirect())
			return doNoCopyWrap(buffer);
		return buffer;
	} 
 
	public static LongBuffer wrapNoCopyDirect(LongBuffer buffer) {
		if (!buffer.isDirect())
			return doNoCopyWrap(buffer);
		return buffer;
	} 
 
	public static DoubleBuffer wrapNoCopyDirect(DoubleBuffer buffer) {
		if (!buffer.isDirect())
			return doNoCopyWrap(buffer);
		return buffer;
	} 
 
	public static void copy(ByteBuffer src, ByteBuffer dst) {
		if (dst != null && !dst.isDirect()) {
			int saved_position = dst.position();
			dst.put(src);
			dst.position(saved_position);
		} 
	} 
 
	public static void copy(ShortBuffer src, ShortBuffer dst) {
		if (dst != null && !dst.isDirect()) {
			int saved_position = dst.position();
			dst.put(src);
			dst.position(saved_position);
		} 
	} 
 
	public static void copy(IntBuffer src, IntBuffer dst) {
		if (dst != null && !dst.isDirect()) {
			int saved_position = dst.position();
			dst.put(src);
			dst.position(saved_position);
		} 
	} 
 
	public static void copy(FloatBuffer src, FloatBuffer dst) {
		if (dst != null && !dst.isDirect()) {
			int saved_position = dst.position();
			dst.put(src);
			dst.position(saved_position);
		} 
	} 
 
	public static void copy(LongBuffer src, LongBuffer dst) {
		if (dst != null && !dst.isDirect()) {
			int saved_position = dst.position();
			dst.put(src);
			dst.position(saved_position);
		} 
	} 
 
	public static void copy(DoubleBuffer src, DoubleBuffer dst) {
		if (dst != null && !dst.isDirect()) {
			int saved_position = dst.position();
			dst.put(src);
			dst.position(saved_position);
		} 
	} 
 
	private static ByteBuffer doNoCopyWrap(ByteBuffer buffer) {
		ByteBuffer direct_buffer = lookupBuffer(buffer);
		direct_buffer.limit(buffer.limit());
		direct_buffer.position(buffer.position());
		return direct_buffer;
	} 
 
	private static ShortBuffer doNoCopyWrap(ShortBuffer buffer) {
		ShortBuffer direct_buffer = lookupBuffer(buffer);
		direct_buffer.limit(buffer.limit());
		direct_buffer.position(buffer.position());
		return direct_buffer;
	} 
 
	private static IntBuffer doNoCopyWrap(IntBuffer buffer) {
		IntBuffer direct_buffer = lookupBuffer(buffer);
		direct_buffer.limit(buffer.limit());
		direct_buffer.position(buffer.position());
		return direct_buffer;
	} 
 
	private static FloatBuffer doNoCopyWrap(FloatBuffer buffer) {
		FloatBuffer direct_buffer = lookupBuffer(buffer);
		direct_buffer.limit(buffer.limit());
		direct_buffer.position(buffer.position());
		return direct_buffer;
	} 
 
	private static LongBuffer doNoCopyWrap(LongBuffer buffer) {
		LongBuffer direct_buffer = lookupBuffer(buffer);