@Override @SuppressWarnings("unchecked") public ByteBuffer reallocateByteBuffer(ByteBuffer oldByteBuffer, int newSize) { if (oldByteBuffer.capacity() >= newSize) return oldByteBuffer; final ThreadLocalPool<ByteBuffer> memoryPool = getByteBufferThreadLocalPool(); if (memoryPool != null) { final ByteBuffer newBuffer = memoryPool.reallocate(oldByteBuffer, newSize); if (newBuffer != null) { ProbeNotifier.notifyBufferAllocatedFromPool(monitoringConfig, newSize - oldByteBuffer.capacity()); return newBuffer; } } ByteBuffer newByteBuffer = allocateByteBuffer(newSize); oldByteBuffer.flip(); return newByteBuffer.put(oldByteBuffer); }
@Override @SuppressWarnings("unchecked") public ByteBuffer reallocateByteBuffer(ByteBuffer oldByteBuffer, int newSize) { if (oldByteBuffer.capacity() >= newSize) return oldByteBuffer; final ThreadLocalPool<ByteBuffer> memoryPool = getByteBufferThreadLocalPool(); if (memoryPool != null) { final ByteBuffer newBuffer = memoryPool.reallocate(oldByteBuffer, newSize); if (newBuffer != null) { ProbeNotifier.notifyBufferAllocatedFromPool(monitoringConfig, newSize - oldByteBuffer.capacity()); return newBuffer; } } ByteBuffer newByteBuffer = allocateByteBuffer(newSize); oldByteBuffer.flip(); return newByteBuffer.put(oldByteBuffer); }
@Override @SuppressWarnings("unchecked") public ByteBuffer reallocateByteBuffer(ByteBuffer oldByteBuffer, int newSize) { if (oldByteBuffer.capacity() >= newSize) return oldByteBuffer; final ThreadLocalPool<ByteBuffer> memoryPool = getByteBufferThreadLocalPool(); if (memoryPool != null) { final ByteBuffer newBuffer = memoryPool.reallocate(oldByteBuffer, newSize); if (newBuffer != null) { ProbeNotifier.notifyBufferAllocatedFromPool(monitoringConfig, newSize - oldByteBuffer.capacity()); return newBuffer; } } ByteBuffer newByteBuffer = allocateByteBuffer(newSize); oldByteBuffer.flip(); return newByteBuffer.put(oldByteBuffer); }
@Override @SuppressWarnings("unchecked") public ByteBuffer reallocateByteBuffer(ByteBuffer oldByteBuffer, int newSize) { if (oldByteBuffer.capacity() >= newSize) return oldByteBuffer; final ThreadLocalPool<ByteBuffer> memoryPool = getByteBufferThreadLocalPool(); if (memoryPool != null) { final ByteBuffer newBuffer = memoryPool.reallocate(oldByteBuffer, newSize); if (newBuffer != null) { ProbeNotifier.notifyBufferAllocatedFromPool(monitoringConfig, newSize - oldByteBuffer.capacity()); return newBuffer; } } ByteBuffer newByteBuffer = allocateByteBuffer(newSize); oldByteBuffer.flip(); return newByteBuffer.put(oldByteBuffer); }
@Override @SuppressWarnings("unchecked") public ByteBuffer reallocateByteBuffer(ByteBuffer oldByteBuffer, int newSize) { if (oldByteBuffer.capacity() >= newSize) return oldByteBuffer; final ThreadLocalPool<ByteBuffer> memoryPool = getByteBufferThreadLocalPool(); if (memoryPool != null) { final ByteBuffer newBuffer = memoryPool.reallocate(oldByteBuffer, newSize); if (newBuffer != null) { ProbeNotifier.notifyBufferAllocatedFromPool(monitoringConfig, newSize - oldByteBuffer.capacity()); return newBuffer; } } ByteBuffer newByteBuffer = allocateByteBuffer(newSize); oldByteBuffer.flip(); return newByteBuffer.put(oldByteBuffer); }
@Override @SuppressWarnings("unchecked") public ByteBuffer reallocateByteBuffer(ByteBuffer oldByteBuffer, int newSize) { if (oldByteBuffer.capacity() >= newSize) return oldByteBuffer; final ThreadLocalPool<ByteBuffer> memoryPool = getByteBufferThreadLocalPool(); if (memoryPool != null) { final ByteBuffer newBuffer = memoryPool.reallocate(oldByteBuffer, newSize); if (newBuffer != null) { ProbeNotifier.notifyBufferAllocatedFromPool(monitoringConfig, newSize - oldByteBuffer.capacity()); return newBuffer; } } ByteBuffer newByteBuffer = allocateByteBuffer(newSize); oldByteBuffer.flip(); return newByteBuffer.put(oldByteBuffer); }
@Override @SuppressWarnings("unchecked") public ByteBuffer reallocateByteBuffer(ByteBuffer oldByteBuffer, int newSize) { if (oldByteBuffer.capacity() >= newSize) return oldByteBuffer; final ThreadLocalPool<ByteBuffer> memoryPool = getByteBufferThreadLocalPool(); if (memoryPool != null) { final ByteBuffer newBuffer = memoryPool.reallocate(oldByteBuffer, newSize); if (newBuffer != null) { ProbeNotifier.notifyBufferAllocatedFromPool(monitoringConfig, newSize - oldByteBuffer.capacity()); return newBuffer; } } ByteBuffer newByteBuffer = allocateByteBuffer(newSize); oldByteBuffer.flip(); return newByteBuffer.put(oldByteBuffer); }
@Override @SuppressWarnings("unchecked") public ByteBuffer reallocateByteBuffer(ByteBuffer oldByteBuffer, int newSize) { if (oldByteBuffer.capacity() >= newSize) return oldByteBuffer; final ThreadLocalPool<ByteBuffer> memoryPool = getByteBufferThreadLocalPool(); if (memoryPool != null) { final ByteBuffer newBuffer = memoryPool.reallocate(oldByteBuffer, newSize); if (newBuffer != null) { ProbeNotifier.notifyBufferAllocatedFromPool(monitoringConfig, newSize - oldByteBuffer.capacity()); return newBuffer; } } ByteBuffer newByteBuffer = allocateByteBuffer(newSize); oldByteBuffer.flip(); return newByteBuffer.put(oldByteBuffer); }
/** * {@inheritDoc} */ @Override public ByteBufferWrapper allocate(final int size) { if (size <= maxSmallBufferSize) { final SmallByteBufferWrapper buffer = createSmallBuffer(); buffer.limit(size); return buffer; } return wrap(allocateByteBuffer(size)); }
/** * {@inheritDoc} */ @Override public ByteBufferWrapper allocate(final int size) { if (size <= maxSmallBufferSize) { final SmallByteBufferWrapper buffer = createSmallBuffer(); buffer.limit(size); return buffer; } return wrap(allocateByteBuffer(size)); }
/** * {@inheritDoc} */ @Override public ByteBufferWrapper allocate(final int size) { if (size <= maxSmallBufferSize) { final SmallByteBufferWrapper buffer = createSmallBuffer(); buffer.limit(size); return buffer; } return wrap(allocateByteBuffer(size)); }
/** * {@inheritDoc} */ @Override public ByteBufferWrapper allocate(final int size) { if (size <= maxSmallBufferSize) { final SmallByteBufferWrapper buffer = createSmallBuffer(); buffer.limit(size); return buffer; } return wrap(allocateByteBuffer(size)); }
/** * {@inheritDoc} */ @Override public ByteBufferWrapper allocate(final int size) { if (size <= maxSmallBufferSize) { final SmallByteBufferWrapper buffer = createSmallBuffer(); buffer.limit(size); return buffer; } return wrap(allocateByteBuffer(size)); }
/** * {@inheritDoc} */ @Override public ByteBufferWrapper allocate(final int size) { if (size <= maxSmallBufferSize) { final SmallByteBufferWrapper buffer = createSmallBuffer(); buffer.limit(size); return buffer; } return wrap(allocateByteBuffer(size)); }
/** * {@inheritDoc} */ @Override public ByteBufferWrapper allocate(final int size) { if (size <= maxSmallBufferSize) { final SmallByteBufferWrapper buffer = createSmallBuffer(); buffer.limit(size); return buffer; } return wrap(allocateByteBuffer(size)); }
/** * {@inheritDoc} */ @Override public ByteBufferWrapper allocate(final int size) { if (size <= maxSmallBufferSize) { final SmallByteBufferWrapper buffer = createSmallBuffer(); buffer.limit(size); return buffer; } return wrap(allocateByteBuffer(size)); }
/** * {@inheritDoc} */ @Override public ByteBufferWrapper allocate(final int size) { if (size <= maxSmallBufferSize) { final SmallByteBufferWrapper buffer = createSmallBuffer(); buffer.limit(size); return buffer; } return wrap(allocateByteBuffer(size)); }
/** * {@inheritDoc} */ @Override public ByteBufferWrapper allocate(final int size) { if (size <= maxSmallBufferSize) { final SmallByteBufferWrapper buffer = createSmallBuffer(); buffer.limit(size); return buffer; } return wrap(allocateByteBuffer(size)); }
/** * {@inheritDoc} */ @Override public ByteBufferWrapper allocate(final int size) { if (size <= maxSmallBufferSize) { final SmallByteBufferWrapper buffer = createSmallBuffer(); buffer.limit(size); return buffer; } return wrap(allocateByteBuffer(size)); }
/** * {@inheritDoc} */ @Override public ByteBufferWrapper allocate(final int size) { if (size <= maxSmallBufferSize) { final SmallByteBufferWrapper buffer = createSmallBuffer(); buffer.limit(size); return buffer; } return wrap(allocateByteBuffer(size)); }