org.apache.hadoop.hbase.util.Bytes.hexCharsToByte()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(124)

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

Bytes.hexCharsToByte介绍

暂无

代码示例

代码示例来源:origin: apache/hbase

/**
 * Create a byte array from a string of hash digits. The length of the
 * string must be a multiple of 2
 * @param hex
 */
public static byte[] fromHex(String hex) {
 checkArgument(hex.length() % 2 == 0, "length must be a multiple of 2");
 int len = hex.length();
 byte[] b = new byte[len / 2];
 for (int i = 0; i < len; i += 2) {
   b[i / 2] = hexCharsToByte(hex.charAt(i),hex.charAt(i+1));
 }
 return b;
}

代码示例来源:origin: org.apache.hbase/hbase-common

/**
 * Create a byte array from a string of hash digits. The length of the
 * string must be a multiple of 2
 * @param hex
 */
public static byte[] fromHex(String hex) {
 checkArgument(hex.length() % 2 == 0, "length must be a multiple of 2");
 int len = hex.length();
 byte[] b = new byte[len / 2];
 for (int i = 0; i < len; i += 2) {
   b[i / 2] = hexCharsToByte(hex.charAt(i),hex.charAt(i+1));
 }
 return b;
}

代码示例来源:origin: com.aliyun.hbase/alihbase-common

/**
 * Create a byte array from a string of hash digits. The length of the
 * string must be a multiple of 2
 * @param hex
 */
public static byte[] fromHex(String hex) {
 checkArgument(hex.length() % 2 == 0, "length must be a multiple of 2");
 int len = hex.length();
 byte[] b = new byte[len / 2];
 for (int i = 0; i < len; i += 2) {
   b[i / 2] = hexCharsToByte(hex.charAt(i),hex.charAt(i+1));
 }
 return b;
}

代码示例来源:origin: harbby/presto-connectors

/**
 * Create a byte array from a string of hash digits. The length of the
 * string must be a multiple of 2
 * @param hex
 */
public static byte[] fromHex(String hex) {
 checkArgument(hex.length() % 2 == 0, "length must be a multiple of 2");
 int len = hex.length();
 byte[] b = new byte[len / 2];
 for (int i = 0; i < len; i += 2) {
   b[i / 2] = hexCharsToByte(hex.charAt(i),hex.charAt(i+1));
 }
 return b;
}

相关文章

微信公众号

最新文章

更多