private void checkSaslComplete() throws IOException {
      if (!saslClient.isComplete()) {
        throw new IOException("Failed to complete SASL handshake");
      }
      Set<String> requestedQop =
        ImmutableSet.copyOf(Arrays.asList(saslProps.get(Sasl.QOP).split(",")));
      String negotiatedQop = getNegotiatedQop();
      // Treat null negotiated QOP as "auth" for the purpose of verification
      // Code elsewhere does the same implicitly
      if (negotiatedQop == null) {
        negotiatedQop = "auth";
      }
      LOG.debug(
        "Verifying QOP, requested QOP = " + requestedQop + ", negotiated QOP = " + negotiatedQop);
      if (!requestedQop.contains(negotiatedQop)) {
        throw new IOException(String.format("SASL handshake completed, but "
          + "channel does not have acceptable quality of protection, "
          + "requested = %s, negotiated(effective) = %s", requestedQop, negotiatedQop));
      }
    }
Create a ByteString from byte array without copying (wrap), and then set it as the payload
for the builder.
@param builder builder for HDFS DataTransferEncryptorMessage.
@param payload byte array of payload.
hbase-asyncfs/src/main/java/org/apache/hadoop/hbase/io/asyncfs/FanOutOneBlockAsyncDFSOutputSaslHelper.java