private void ensureCapacity(int capacity) { if (capacity <= buffer.capacity()) return; ByteBuffer resized = BufferUtils.createAlignedByteBufferPage(mathRoundPoT(capacity)); resized.put(buffer); resized.clear(); buffer = resized; address = memAddress(resized); }
public APIBuffer() { buffer = BufferUtils.createAlignedByteBufferPage(DEFAULT_CAPACITY); address = memAddress(buffer); }