say if I have a big ShortBuffer with only 5 relevant items starting at position 0, and a small buffer with less capacity than the big buffer…
How would I ‘put’ the 5 values from the big buffer into the small buffer without getting a buffer overflow or having to manually index all of them?
currently throwing a buffer overflow exception with this:
indexBuffer.position(0);
subMeshes.get(subMeshIndex).indexBuffer.position(0);
subMeshes.get(subMeshIndex).indexBuffer.put(indexBuffer);
edit:
also please note that I’ll need to change the data from the large buffer afterwards so shared memory options like duplicate etc. are off the table
If I am understanding your needs correctly, the easiest thing to do would be to set a limit on the larger buffer. When you do a bulk
putit will only transfer up tolimititems. You can do this by: