本文整理了Java中org.apache.hadoop.hbase.util.Bytes.hexCharsToByte()
方法的一些代码示例,展示了Bytes.hexCharsToByte()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bytes.hexCharsToByte()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.util.Bytes
类名称: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;
}
内容来源于网络,如有侵权,请联系作者删除!