/** * Create a new ByteBuffer of the specified size. * * @param size * required number of ints to store. * @return the new IntBuffer */ public static ByteBuffer createByteBuffer(int size) { ByteBuffer buf = allocator.allocate(size).order(ByteOrder.nativeOrder()); buf.clear(); onBufferAllocated(buf); return buf; }
/** * Create a new FloatBuffer of the specified size. * * @param size * required number of floats to store. * @return the new FloatBuffer */ public static FloatBuffer createFloatBuffer(int size) { FloatBuffer buf = allocator.allocate(4 * size).order(ByteOrder.nativeOrder()).asFloatBuffer(); buf.clear(); onBufferAllocated(buf); return buf; }
/** * Create a new IntBuffer of the specified size. * * @param size * required number of ints to store. * @return the new IntBuffer */ public static IntBuffer createIntBuffer(int size) { IntBuffer buf = allocator.allocate(4 * size).order(ByteOrder.nativeOrder()).asIntBuffer(); buf.clear(); onBufferAllocated(buf); return buf; }
/** * Create a new ShortBuffer of the specified size. * * @param size * required number of shorts to store. * @return the new ShortBuffer */ public static ShortBuffer createShortBuffer(int size) { ShortBuffer buf = allocator.allocate(2 * size).order(ByteOrder.nativeOrder()).asShortBuffer(); buf.clear(); onBufferAllocated(buf); return buf; }
/** * Create a new DoubleBuffer of the specified size. * * @param size * required number of double to store. * @return the new DoubleBuffer */ public static DoubleBuffer createDoubleBuffer(int size) { DoubleBuffer buf = allocator.allocate(8 * size).order(ByteOrder.nativeOrder()).asDoubleBuffer(); buf.clear(); onBufferAllocated(buf); return buf; }
/** * Create a new ByteBuffer of the specified size. * * @param size * required number of ints to store. * @return the new IntBuffer */ public static ByteBuffer createByteBuffer(int size) { ByteBuffer buf = ByteBuffer.allocateDirect(size).order(ByteOrder.nativeOrder()); buf.clear(); onBufferAllocated(buf); return buf; }
/** * Create a new FloatBuffer of the specified size. * * @param size * required number of floats to store. * @return the new FloatBuffer */ public static FloatBuffer createFloatBuffer(int size) { FloatBuffer buf = ByteBuffer.allocateDirect(4 * size).order(ByteOrder.nativeOrder()).asFloatBuffer(); buf.clear(); onBufferAllocated(buf); return buf; }
/** * Create a new IntBuffer of the specified size. * * @param size * required number of ints to store. * @return the new IntBuffer */ public static IntBuffer createIntBuffer(int size) { IntBuffer buf = ByteBuffer.allocateDirect(4 * size).order(ByteOrder.nativeOrder()).asIntBuffer(); buf.clear(); onBufferAllocated(buf); return buf; }
/** * Create a new ByteBuffer of the specified size. * * @param size * required number of ints to store. * @return the new IntBuffer */ public static ByteBuffer createByteBuffer(int size) { ByteBuffer buf = allocator.allocate(size).order(ByteOrder.nativeOrder()); buf.clear(); onBufferAllocated(buf); return buf; }
/** * Create a new ShortBuffer of the specified size. * * @param size * required number of shorts to store. * @return the new ShortBuffer */ public static ShortBuffer createShortBuffer(int size) { ShortBuffer buf = ByteBuffer.allocateDirect(2 * size).order(ByteOrder.nativeOrder()).asShortBuffer(); buf.clear(); onBufferAllocated(buf); return buf; }
/** * Create a new DoubleBuffer of the specified size. * * @param size * required number of double to store. * @return the new DoubleBuffer */ public static DoubleBuffer createDoubleBuffer(int size) { DoubleBuffer buf = ByteBuffer.allocateDirect(8 * size).order(ByteOrder.nativeOrder()).asDoubleBuffer(); buf.clear(); onBufferAllocated(buf); return buf; }
/** * Create a new IntBuffer of the specified size. * * @param size * required number of ints to store. * @return the new IntBuffer */ public static IntBuffer createIntBuffer(int size) { IntBuffer buf = allocator.allocate(4 * size).order(ByteOrder.nativeOrder()).asIntBuffer(); buf.clear(); onBufferAllocated(buf); return buf; }
/** * Create a new ShortBuffer of the specified size. * * @param size * required number of shorts to store. * @return the new ShortBuffer */ public static ShortBuffer createShortBuffer(int size) { ShortBuffer buf = allocator.allocate(2 * size).order(ByteOrder.nativeOrder()).asShortBuffer(); buf.clear(); onBufferAllocated(buf); return buf; }
/** * Create a new DoubleBuffer of the specified size. * * @param size * required number of double to store. * @return the new DoubleBuffer */ public static DoubleBuffer createDoubleBuffer(int size) { DoubleBuffer buf = allocator.allocate(8 * size).order(ByteOrder.nativeOrder()).asDoubleBuffer(); buf.clear(); onBufferAllocated(buf); return buf; }
/** * Create a new FloatBuffer of the specified size. * * @param size * required number of floats to store. * @return the new FloatBuffer */ public static FloatBuffer createFloatBuffer(int size) { FloatBuffer buf = allocator.allocate(4 * size).order(ByteOrder.nativeOrder()).asFloatBuffer(); buf.clear(); onBufferAllocated(buf); return buf; }