docs: public WsByteBuffer allocateCommon(int entrySize, boolean direct) {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
              Tr.entry(tc, "allocateCommon: " + entrySize);
          }
  
          // see if we should look for leaks
          if (trackingBuffers()) {
              lookForLeaks(false);
          }
  
          for (int i = 0; i < this.poolSizes.length; i++) {
              ByteBuffer bytebufferFromPool = null;
              int intPoolSize = this.poolSizes[i];
  
              // find the correct pool from which to get the buffer
              if (entrySize <= intPoolSize) {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                      Tr.debug(tc, "found a pool of size: " + intPoolSize);
                  }
  
                  WsByteBufferPool oWsByteBufferPool = null;
                  // get the pool that should be used
                  if (direct) {
                      oWsByteBufferPool = this.poolsDirect[i];
                  } else {
                      oWsByteBufferPool = this.pools[i];
                  }
  
                  // allocate an entry from the pool
                  PooledWsByteBufferImpl pooledWSBB = oWsByteBufferPool.getEntry();
                  // reset released flag so this buffer can be used again
                  pooledWSBB.resetReleaseCalled();
  
                  bytebufferFromPool = pooledWSBB.getWrappedByteBufferNonSafe();
                  if (bytebufferFromPool == null) {
                      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                          Tr.debug(tc, "no ByteBuffer so alloc a new one");
                      }
                      // allocate the ByteBuffer and store it in the PoolEntry
                      if (direct) {
                          allocateBufferDirect(pooledWSBB, intPoolSize, false);
                          pooledWSBB.setIsDirectPool(true);
                      } else {
                          bytebufferFromPool = ByteBuffer.allocate(intPoolSize);
                          pooledWSBB.setIsDirectPool(false);
                          pooledWSBB.setByteBufferNonSafe(bytebufferFromPool);
                      }
                      // keep the pool index for this entry,to quickly access on the release
                      pooledWSBB.pool = oWsByteBufferPool;
  
                      // WsByteBuffer needs to call back to us for duplicates/release/slice
                      pooledWSBB.setPoolManagerRef(this);
                  } else {
  
                      // reset the limit, position and mark to the "beginning"
                      bytebufferFromPool.clear();
  
                      // reset the byte order back to the default
                      bytebufferFromPool.order(java.nio.ByteOrder.BIG_ENDIAN);
  
                      // reset the refCount
                      pooledWSBB.intReferenceCount = 1;
  
                      // reset buffer optomization algorithmic variables.
                      pooledWSBB.getMin = -1;
                      pooledWSBB.getMax = -1;
                      pooledWSBB.putMin = -1;
                      pooledWSBB.putMax = -1;
                      pooledWSBB.readMin = -1;
                      pooledWSBB.readMax = -1;
                      pooledWSBB.actionState = PooledWsByteBufferImpl.COPY_ALL_INIT;
                      pooledWSBB.quickBufferAction = WsByteBufferImpl.NOT_ACTIVATED;
                  }
  
                  // set the limit to the size, the user can set limit to
                  // capacity if they want to use any possible extra space
                  pooledWSBB.limit(entrySize);
  
                  if ((TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                      || trackingBuffers()) {
  
                      Throwable t = new Throwable();
                      StackTraceElement[] ste = t.getStackTrace();
                      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                          if (ste.length >= 3) {
                              Tr.debug(tc,
                                       "BUFFER OBTAINED: Allocate: Calling Element: " + ste[2] + " Main ID: " + pooledWSBB.getID());
                          }
                          Tr.debug(tc, "Buffer allocated: " + pooledWSBB);
                      }
  
                      if (trackingBuffers()) {
                          String sEntry = fillOutStackTrace(" (Allocate) ", ste);
                          pooledWSBB.setOwnerID(sEntry);
  
                          pooledWSBB.addWsByteBuffer(pooledWSBB);
                          pooledWSBB.addOwner(pooledWSBB.getOwnerID());
                      }
                  }
  
                  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
                      Tr.exit(tc, "allocateCommon");
                  }
                  return pooledWSBB;
              }
          } // end-pool loop
  
          // Either we have no pools or the allocate size is bigger
          // than our biggest pool, so allocate "as is"
          WsByteBufferImpl buffer = new WsByteBufferImpl();
  
          if (direct) {
              buffer = allocateBufferDirect(buffer, entrySize, true);
          } else {
              buffer.setByteBufferNonSafe(ByteBuffer.allocate(entrySize));
          }
  
          // WsByteBuffer needs to call back to us for duplicates/release/slice
          buffer.setPoolManagerRef(this);
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
              Tr.debug(tc, "Buffer allocated: " + buffer);
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
              Tr.exit(tc, "allocateCommon");
          }
          return buffer;
      }