public static Credentials credentialsFromByteArray(byte[] binaryCredentials)
      throws IOException  {
    Credentials credentials = new Credentials();
    DataInputBuffer dib = new DataInputBuffer();
    dib.reset(binaryCredentials, binaryCredentials.length);
    credentials.readTokenStorageStream(dib);
    return credentials;
  }
transform a byte of crendetials to a hadoop Credentials object.
@param binaryCredentials credentials in byte format as they would
                         usually be when received from protobuffers
@return a hadoop Credentials object
llap-common/src/java/org/apache/hadoop/hive/llap/LlapUtil.java