private void writeResponse(ChannelHandlerContext ctx, byte[] response) {
    LOG.trace("Sending token size={} from initSASLContext.", response.length);
    NettyFutureUtils.safeWriteAndFlush(ctx,
      ctx.alloc().buffer(4 + response.length).writeInt(response.length).writeBytes(response));
  }
@param saslPromise {@code true} if success, {@code false} if server tells us to fallback to
                   simple.
hbase-client/src/main/java/org/apache/hadoop/hbase/security/NettyHBaseSaslRpcClientHandler.java