MCPcopy Index your code
hub / github.com/processing/processing / updateByteBuffer

Method updateByteBuffer

core/src/processing/opengl/PGL.java:2321–2343  ·  view source on GitHub ↗
(ByteBuffer buf, byte[] arr,
                                               boolean wrap)

Source from the content-addressed store, hash-verified

2319
2320
2321 protected static ByteBuffer updateByteBuffer(ByteBuffer buf, byte[] arr,
2322 boolean wrap) {
2323 if (USE_DIRECT_BUFFERS) {
2324 if (buf == null || buf.capacity() < arr.length) {
2325 buf = allocateDirectByteBuffer(arr.length);
2326 }
2327 buf.position(0);
2328 buf.put(arr);
2329 buf.rewind();
2330 } else {
2331 if (wrap) {
2332 buf = ByteBuffer.wrap(arr);
2333 } else {
2334 if (buf == null || buf.capacity() < arr.length) {
2335 buf = ByteBuffer.allocate(arr.length);
2336 }
2337 buf.position(0);
2338 buf.put(arr);
2339 buf.rewind();
2340 }
2341 }
2342 return buf;
2343 }
2344
2345
2346 protected static void updateByteBuffer(ByteBuffer buf, byte[] arr,

Callers 1

updateAttribBufferMethod · 0.95

Calls 5

wrapMethod · 0.80
putMethod · 0.45
allocateMethod · 0.45
arrayMethod · 0.45

Tested by

no test coverage detected