本文整理了Java中aQute.lib.hex.Hex
类的一些代码示例,展示了Hex
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hex
类的具体详情如下:
包路径:aQute.lib.hex.Hex
类名称:Hex
暂无
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
public final static String toHexString(byte data[]) {
StringBuilder sb = new StringBuilder();
try {
append(sb, data);
} catch (IOException e) {
// cannot happen with sb
}
return sb.toString();
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
public final static void append(Appendable sb, byte[] data) throws IOException {
for (int i = 0; i < data.length; i++) {
sb.append(nibble(data[i] >> 4));
sb.append(nibble(data[i]));
}
}
代码示例来源:origin: org.osgi/osgi.enroute.jsonrpc.simple.provider
@Override
public Object convert(Type dest, Object o) throws Exception {
if (o instanceof String) {
String s = (String) o;
if (Hex.isHex(s))
return Hex.toByteArray(s);
}
return null;
}
});
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
@Override
public String toString() {
try {
return "P-" + getResource();
} catch (Exception e) {
return "P-" + Hex.toHexString(sha);
}
}
代码示例来源:origin: biz.aQute/bndlib
@Override
Object decode(Decoder dec, String s) throws Exception {
return Hex.toByteArray(s);
}
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
if (!Hex.isHex(unicode)) {
error("Invalid unicode string \\u%s", sb);
return '?';
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
public static String separated(byte[] bytes, String separator) {
String del="";
StringBuilder sb = new StringBuilder();
for ( byte x : bytes) {
sb.append(del);
sb.append(toHex(x));
del = separator;
}
return sb.toString();
}
}
代码示例来源:origin: org.osgi/osgi.enroute.jsonrpc.simple.provider
@Override
public
void encode(Encoder app, Object object, Map<Object,Type> visited) throws IOException, Exception {
StringHandler.string(app, Hex.toHexString((byte[]) object));
}
代码示例来源:origin: org.osgi/osgi.enroute.rest.simple.provider
@Override
public Object convert(Type dest, Object o) throws Exception {
if (o instanceof String)
return Hex.toByteArray((String) o);
return null;
}
});
代码示例来源:origin: biz.aQute.bnd/bndlib
if (!Hex.isHex(head)) {
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
public static String separated(byte[] bytes, String separator) {
String del="";
StringBuilder sb = new StringBuilder();
for ( byte x : bytes) {
sb.append(del);
sb.append(toHex(x));
del = separator;
}
return sb.toString();
}
}
代码示例来源:origin: biz.aQute.bnd/bndlib
public String toString() {
try {
return "P-" + getResource();
}
catch (Exception e) {
return "P-" + Hex.toHexString(sha);
}
}
代码示例来源:origin: biz.aQute.bnd/bndlib
public final static void append(Appendable sb, byte[] data) throws IOException {
for (int i = 0; i < data.length; i++) {
sb.append(nibble(data[i] >> 4));
sb.append(nibble(data[i]));
}
}
代码示例来源:origin: biz.aQute/bndlib
public final static String toHexString(byte data[]) {
StringBuilder sb = new StringBuilder();
try {
append(sb, data);
}
catch (IOException e) {
// cannot happen with sb
}
return sb.toString();
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
@Override
public void setProperties(Map<String, String> map) throws Exception {
super.setProperties(map);
String email = map.get(EMAIL);
if (email == null) {
Settings settings = registry.getPlugin(Settings.class);
email = settings.getEmail();
if (email == null) {
error(
"The bnd authentication URL connection handler has no email set as property, nor have the bnd settings been set");
return;
}
credentials(email, settings.getPublicKey(), settings.getPrivateKey());
} else {
String pub = map.get(PUBLIC_KEY);
String prv = map.get(PRIVATE_KEY);
if (pub == null || !Hex.isHex(pub)) {
error("The bnd authentication URL public key for email %s is not a hex string %s", email, pub);
return;
}
if (prv == null || !Hex.isHex(prv)) {
error("The bnd authentication URL private key for email %s is not a hex string", email);
return;
}
credentials(email, Hex.toByteArray(pub), Hex.toByteArray(prv));
}
machine = map.get(MACHINE);
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
return Hex.toByteArray(sb.toString());
else
return Base64.decodeBase64(sb.toString());
代码示例来源:origin: biz.aQute.bnd/bnd
if (!Hex.isHex(head)) {
代码示例来源:origin: biz.aQute.bnd/biz.aQute.repository
public static String separated(byte[] bytes, String separator) {
String del="";
StringBuilder sb = new StringBuilder();
for ( byte x : bytes) {
sb.append(del);
sb.append(toHex(x));
del = separator;
}
return sb.toString();
}
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
@Override
public String toString() {
try {
return "P-" + getResource();
} catch (Exception e) {
return "P-" + Hex.toHexString(sha);
}
}
代码示例来源:origin: org.osgi/osgi.enroute.authenticator.simple.provider
public final static void append(Appendable sb, byte[] data) throws IOException {
for (int i = 0; i < data.length; i++) {
sb.append(nibble(data[i] >> 4));
sb.append(nibble(data[i]));
}
}
内容来源于网络,如有侵权,请联系作者删除!