Wouldn’t this be great?
`
int size = 1024;
FloatBuffer buf = ByteBuffer.allocateDirect( size * Float.SIZE / 8 ).order(ByteOrder.nativeOrder()).asFloatBuffer();
float[] arr = buf.asFloatArray();
ShortBuffer buf = ByteBuffer.allocateDirect( size * Short.SIZE / 8 ).order(ByteOrder.nativeOrder()).asShortBuffer();
short[] arr = buf.asShortArray();
`
Then we could finally get around the performance-difference and handling between the two.
Is it possible to do this with JNI?