code: private ByteBuf allocate(ChannelHandlerContext ctx, int capacity) {
          ByteBufAllocator alloc = ctx.alloc();
          if (engineType.wantsDirectBuffer) {
              return alloc.directBuffer(capacity);
          } else {
              return alloc.buffer(capacity);
          }
      }
docs: Always prefer a direct buffer when it's pooled, so that we reduce the number of memory copies
  in {@link OpenSslEngine}.