(IntBuffer buf, int[] arr,
boolean wrap)
| 2561 | |
| 2562 | |
| 2563 | protected static IntBuffer updateIntBuffer(IntBuffer buf, int[] arr, |
| 2564 | boolean wrap) { |
| 2565 | if (USE_DIRECT_BUFFERS || (buf != null && buf.isDirect())) { |
| 2566 | if (buf == null || buf.capacity() < arr.length) { |
| 2567 | buf = allocateDirectIntBuffer(arr.length); |
| 2568 | } |
| 2569 | buf.position(0); |
| 2570 | buf.put(arr); |
| 2571 | buf.rewind(); |
| 2572 | } else { |
| 2573 | if (wrap) { |
| 2574 | buf = IntBuffer.wrap(arr); |
| 2575 | } else { |
| 2576 | if (buf == null || buf.capacity() < arr.length) { |
| 2577 | buf = IntBuffer.allocate(arr.length); |
| 2578 | } |
| 2579 | buf.position(0); |
| 2580 | buf.put(arr); |
| 2581 | buf.rewind(); |
| 2582 | } |
| 2583 | } |
| 2584 | return buf; |
| 2585 | } |
| 2586 | |
| 2587 | |
| 2588 | protected static void updateIntBuffer(IntBuffer buf, int[] arr, |
no test coverage detected