(FloatBuffer buf, float[] arr,
boolean wrap)
| 2594 | |
| 2595 | |
| 2596 | protected static FloatBuffer updateFloatBuffer(FloatBuffer buf, float[] arr, |
| 2597 | boolean wrap) { |
| 2598 | if (USE_DIRECT_BUFFERS) { |
| 2599 | if (buf == null || buf.capacity() < arr.length) { |
| 2600 | buf = allocateDirectFloatBuffer(arr.length); |
| 2601 | } |
| 2602 | buf.position(0); |
| 2603 | buf.put(arr); |
| 2604 | buf.rewind(); |
| 2605 | } else { |
| 2606 | if (wrap) { |
| 2607 | buf = FloatBuffer.wrap(arr); |
| 2608 | } else { |
| 2609 | if (buf == null || buf.capacity() < arr.length) { |
| 2610 | buf = FloatBuffer.allocate(arr.length); |
| 2611 | } |
| 2612 | buf.position(0); |
| 2613 | buf.put(arr); |
| 2614 | buf.rewind(); |
| 2615 | } |
| 2616 | } |
| 2617 | return buf; |
| 2618 | } |
| 2619 | |
| 2620 | |
| 2621 | protected static void updateFloatBuffer(FloatBuffer buf, float[] arr, |
no test coverage detected