private ByteBuffer acquireDirectBuffer(int size, boolean send) {
    ByteBuffer result;

    if (useDirectBuffers) {
      if (size <= MEDIUM_BUFFER_SIZE) {
        result = acquirePredefinedFixedBuffer(send, size);
      } else {
        result = acquireLargeBuffer(send, size);
      }
      if (result.capacity() > size) {
        result.position(0).limit(size);
        result = result.slice();
      }
      return result;
    }
    // if we are using heap buffers then don't bother with keeping them around
    result = ByteBuffer.allocate(size);
    updateBufferStats(size, send, false);
    return result;
  }
try to acquire direct buffer, if enabled by configuration
geode-core/src/main/java/org/apache/geode/internal/net/BufferPool.java