org.apache.activemq.artemis.utils.Base64.encodeBytes()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(213)

本文整理了Java中org.apache.activemq.artemis.utils.Base64.encodeBytes()方法的一些代码示例,展示了Base64.encodeBytes()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Base64.encodeBytes()方法的具体详情如下:
包路径:org.apache.activemq.artemis.utils.Base64
类名称:Base64
方法名:encodeBytes

Base64.encodeBytes介绍

[英]Encodes a byte array into Base64 notation. Does not GZip-compress data.
[中]将字节数组编码为Base64表示法。不压缩数据。

代码示例

代码示例来源:origin: wildfly/wildfly

/**
* Encodes a byte array into Base64 notation.
* Does not GZip-compress data.
*
* @param source The data to convert
* @return Base64 String
* @since 1.4
*/
public static String encodeBytes(final byte[] source) {
 return Base64.encodeBytes(source, 0, source.length, Base64.NO_OPTIONS);
} // end encodeBytes

代码示例来源:origin: wildfly/wildfly

/**
* Encodes a byte array into Base64 notation.
* Does not GZip-compress data.
*
* @param source The data to convert
* @param off    Offset in array where conversion should begin
* @param len    Length of data to convert
* @return Encoded String
* @since 1.4
*/
public static String encodeBytes(final byte[] source, final int off, final int len) {
 return Base64.encodeBytes(source, off, len, Base64.NO_OPTIONS);
} // end encodeBytes

代码示例来源:origin: wildfly/wildfly

/**
* Encodes a byte array into Base64 notation.
* <p>
* Valid options:<pre>
*   GZIP: gzip-compresses object before encoding it.
*   DONT_BREAK_LINES: don't break lines at 76 characters
*     <i>Note: Technically, this makes your encoding non-compliant.</i>
* </pre>
* <p>
* Example: <code>encodeBytes( myData, Base64.GZIP )</code> or
* <p>
* Example: <code>encodeBytes( myData, Base64.GZIP | Base64.DONT_BREAK_LINES )</code>
*
* @param source  The data to convert
* @param options Specified options
* @return Encoded String
* @see Base64#GZIP
* @see Base64#DONT_BREAK_LINES
* @since 2.0
*/
public static String encodeBytes(final byte[] source, final int options) {
 return Base64.encodeBytes(source, 0, source.length, options);
} // end encodeBytes

代码示例来源:origin: wildfly/wildfly

public static String createExpectedResponse(final String magicNumber, final String secretKey) throws IOException {
   try {
     final String concat = secretKey + magicNumber;
     final MessageDigest digest = MessageDigest.getInstance("SHA1");

     digest.update(concat.getBytes(StandardCharsets.UTF_8));
     final byte[] bytes = digest.digest();
     return encodeBytes(bytes);
   } catch (NoSuchAlgorithmException e) {
     throw new IOException(e);
   }
  }
}

代码示例来源:origin: wildfly/wildfly

public static String toBase64String(final Xid xid) {
 byte[] data = XidImpl.toByteArray(xid);
 return Base64.encodeBytes(data, 0, data.length, Base64.DONT_BREAK_LINES | Base64.URL_SAFE);
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

/**
* Encodes a byte array into Base64 notation.
* Does not GZip-compress data.
*
* @param source The data to convert
* @return Base64 String
* @since 1.4
*/
public static String encodeBytes(final byte[] source) {
 return Base64.encodeBytes(source, 0, source.length, Base64.NO_OPTIONS);
} // end encodeBytes

代码示例来源:origin: apache/activemq-artemis

/**
* Encodes a byte array into Base64 notation.
* Does not GZip-compress data.
*
* @param source The data to convert
* @return Base64 String
* @since 1.4
*/
public static String encodeBytes(final byte[] source) {
 return Base64.encodeBytes(source, 0, source.length, Base64.NO_OPTIONS);
} // end encodeBytes

代码示例来源:origin: apache/activemq-artemis

/**
* Encodes a byte array into Base64 notation.
* Does not GZip-compress data.
*
* @param source The data to convert
* @return Base64 String
* @since 1.4
*/
public static String encodeBytes(final byte[] source) {
 return Base64.encodeBytes(source, 0, source.length, Base64.NO_OPTIONS);
} // end encodeBytes

代码示例来源:origin: apache/activemq-artemis

protected static String encode(final byte[] data) {
   return Base64.encodeBytes(data, 0, data.length, Base64.DONT_BREAK_LINES | Base64.URL_SAFE);
  }
}

代码示例来源:origin: org.apache.activemq/artemis-jms-client-all

/**
* Encodes a byte array into Base64 notation.
* Does not GZip-compress data.
*
* @param source The data to convert
* @param off    Offset in array where conversion should begin
* @param len    Length of data to convert
* @return Encoded String
* @since 1.4
*/
public static String encodeBytes(final byte[] source, final int off, final int len) {
 return Base64.encodeBytes(source, off, len, Base64.NO_OPTIONS);
} // end encodeBytes

代码示例来源:origin: org.apache.activemq/artemis-commons

/**
* Encodes a byte array into Base64 notation.
* Does not GZip-compress data.
*
* @param source The data to convert
* @param off    Offset in array where conversion should begin
* @param len    Length of data to convert
* @return Encoded String
* @since 1.4
*/
public static String encodeBytes(final byte[] source, final int off, final int len) {
 return Base64.encodeBytes(source, off, len, Base64.NO_OPTIONS);
} // end encodeBytes

代码示例来源:origin: org.apache.activemq/artemis-cli

protected static String encode(final byte[] data) {
   return Base64.encodeBytes(data, 0, data.length, Base64.DONT_BREAK_LINES | Base64.URL_SAFE);
  }
}

代码示例来源:origin: apache/activemq-artemis

public static String createExpectedResponse(final String magicNumber, final String secretKey) throws IOException {
   try {
     final String concat = secretKey + magicNumber;
     final MessageDigest digest = MessageDigest.getInstance("SHA1");

     digest.update(concat.getBytes(StandardCharsets.UTF_8));
     final byte[] bytes = digest.digest();
     return encodeBytes(bytes);
   } catch (NoSuchAlgorithmException e) {
     throw new IOException(e);
   }
  }
}

代码示例来源:origin: apache/activemq-artemis

public static String createExpectedResponse(final String magicNumber, final String secretKey) throws IOException {
   try {
     final String concat = secretKey + magicNumber;
     final MessageDigest digest = MessageDigest.getInstance("SHA1");

     digest.update(concat.getBytes(StandardCharsets.UTF_8));
     final byte[] bytes = digest.digest();
     return encodeBytes(bytes);
   } catch (NoSuchAlgorithmException e) {
     throw new IOException(e);
   }
  }
}

代码示例来源:origin: apache/activemq-artemis

public static String createExpectedResponse(final String magicNumber, final String secretKey) throws IOException {
   try {
     final String concat = secretKey + magicNumber;
     final MessageDigest digest = MessageDigest.getInstance("SHA1");

     digest.update(concat.getBytes(StandardCharsets.UTF_8));
     final byte[] bytes = digest.digest();
     return encodeBytes(bytes);
   } catch (NoSuchAlgorithmException e) {
     throw new IOException(e);
   }
  }
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

public static String createExpectedResponse(final String magicNumber, final String secretKey) throws IOException {
   try {
     final String concat = secretKey + magicNumber;
     final MessageDigest digest = MessageDigest.getInstance("SHA1");

     digest.update(concat.getBytes(StandardCharsets.UTF_8));
     final byte[] bytes = digest.digest();
     return encodeBytes(bytes);
   } catch (NoSuchAlgorithmException e) {
     throw new IOException(e);
   }
  }
}

代码示例来源:origin: org.apache.activemq/artemis-core-client

public static String createExpectedResponse(final String magicNumber, final String secretKey) throws IOException {
   try {
     final String concat = secretKey + magicNumber;
     final MessageDigest digest = MessageDigest.getInstance("SHA1");

     digest.update(concat.getBytes(StandardCharsets.UTF_8));
     final byte[] bytes = digest.digest();
     return encodeBytes(bytes);
   } catch (NoSuchAlgorithmException e) {
     throw new IOException(e);
   }
  }
}

代码示例来源:origin: apache/activemq-artemis

public static String toBase64String(final Xid xid) {
 byte[] data = XidImpl.toByteArray(xid);
 return Base64.encodeBytes(data, 0, data.length, Base64.DONT_BREAK_LINES | Base64.URL_SAFE);
}

代码示例来源:origin: apache/activemq-artemis

public static String toBase64String(final Xid xid) {
 byte[] data = XidImpl.toByteArray(xid);
 return Base64.encodeBytes(data, 0, data.length, Base64.DONT_BREAK_LINES | Base64.URL_SAFE);
}

代码示例来源:origin: apache/activemq-artemis

public static String toBase64String(final Xid xid) {
 byte[] data = XidImpl.toByteArray(xid);
 return Base64.encodeBytes(data, 0, data.length, Base64.DONT_BREAK_LINES | Base64.URL_SAFE);
}

相关文章