org.glassfish.jersey.internal.util.Base64.decode()方法的使用及代码示例

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

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

Base64.decode介绍

[英]Decodes Base64 data into octects.
[中]将Base64数据解码为八位字节。

代码示例

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

/**
 * Decodes array of bytes using base64 decoding and returns the result as a string.
 *
 * @param buffer Array of bytes to be decoded.
 * @return Resulting decoded string.
 */
public static String decodeAsString(final byte[] buffer) {
  final byte[] result = decode(buffer);
  try {
    return new String(result, "ASCII");
  } catch (final UnsupportedEncodingException ex) {
    // should never happen
    return new String(result);
  }
}

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

/**
 * Decodes array of bytes using base64 decoding and returns the result as a string.
 *
 * @param buffer Array of bytes to be decoded.
 * @return Resulting decoded string.
 */
public static String decodeAsString(final byte[] buffer) {
  final byte[] result = decode(buffer);
  try {
    return new String(result, "ASCII");
  } catch (final UnsupportedEncodingException ex) {
    // should never happen
    return new String(result);
  }
}

代码示例来源:origin: hstaudacher/osgi-jax-rs-connector

/**
 * Decodes array of bytes using base64 decoding and returns the result as a string.
 *
 * @param buffer Array of bytes to be decoded.
 * @return Resulting decoded string.
 */
public static String decodeAsString(final byte[] buffer) {
  final byte[] result = decode(buffer);
  try {
    return new String(result, "ASCII");
  } catch (final UnsupportedEncodingException ex) {
    // should never happen
    return new String(result);
  }
}

代码示例来源:origin: hstaudacher/osgi-jax-rs-connector

/**
 * Decodes array of bytes using base64 decoding and returns the result as a string.
 *
 * @param buffer Array of bytes to be decoded.
 * @return Resulting decoded string.
 */
public static String decodeAsString(final byte[] buffer) {
  final byte[] result = decode(buffer);
  try {
    return new String(result, "ASCII");
  } catch (final UnsupportedEncodingException ex) {
    // should never happen
    return new String(result);
  }
}

代码示例来源:origin: org.glassfish.jersey.bundles/jaxrs-ri

/**
 * Decodes array of bytes using base64 decoding and returns the result as a string.
 *
 * @param buffer Array of bytes to be decoded.
 * @return Resulting decoded string.
 */
public static String decodeAsString(final byte[] buffer) {
  final byte[] result = decode(buffer);
  try {
    return new String(result, "ASCII");
  } catch (final UnsupportedEncodingException ex) {
    // should never happen
    return new String(result);
  }
}

代码示例来源:origin: org.glassfish.jersey.core/jersey-common

/**
 * Decodes array of bytes using base64 decoding and returns the result as a string.
 *
 * @param buffer Array of bytes to be decoded.
 * @return Resulting decoded string.
 */
public static String decodeAsString(final byte[] buffer) {
  final byte[] result = decode(buffer);
  try {
    return new String(result, "ASCII");
  } catch (final UnsupportedEncodingException ex) {
    // should never happen
    return new String(result);
  }
}

代码示例来源:origin: com.eclipsesource.jaxrs/jersey-all

/**
 * Decodes array of bytes using base64 decoding and returns the result as a string.
 *
 * @param buffer Array of bytes to be decoded.
 * @return Resulting decoded string.
 */
public static String decodeAsString(final byte[] buffer) {
  final byte[] result = decode(buffer);
  try {
    return new String(result, "ASCII");
  } catch (final UnsupportedEncodingException ex) {
    // should never happen
    return new String(result);
  }
}

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

byte[] decodedBytes = Base64.decode(auth.replaceFirst("[B|b]asic ", "").getBytes());
String[] lap = new String(decodedBytes).split(":", 2);
if (lap == null || lap.length != 2) {

相关文章

微信公众号

最新文章

更多