本文整理了Java中hudson.remoting.Which.hexToInt()
方法的一些代码示例,展示了Which.hexToInt()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Which.hexToInt()
方法的具体详情如下:
包路径:hudson.remoting.Which
类名称:Which
方法名:hexToInt
暂无
代码示例来源:origin: org.eclipse.hudson/hudson-remoting
/**
* Decode '%HH'.
*/
private static String decode(String s) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
for( int i=0; i<s.length();i++ ) {
char ch = s.charAt(i);
if(ch=='%') {
baos.write(hexToInt(s.charAt(i+1))*16 + hexToInt(s.charAt(i+2)));
i+=2;
continue;
}
baos.write(ch);
}
try {
return new String(baos.toByteArray(),"UTF-8");
} catch (UnsupportedEncodingException e) {
throw new Error(e); // impossible
}
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-remoting
/**
* Decode '%HH'.
*/
private static String decode(String s) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
for( int i=0; i<s.length();i++ ) {
char ch = s.charAt(i);
if(ch=='%') {
baos.write(hexToInt(s.charAt(i+1))*16 + hexToInt(s.charAt(i+2)));
i+=2;
continue;
}
baos.write(ch);
}
try {
return new String(baos.toByteArray(),"UTF-8");
} catch (UnsupportedEncodingException e) {
throw new Error(e); // impossible
}
}
代码示例来源:origin: hudson/hudson-2.x
/**
* Decode '%HH'.
*/
private static String decode(String s) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
for( int i=0; i<s.length();i++ ) {
char ch = s.charAt(i);
if(ch=='%') {
baos.write(hexToInt(s.charAt(i+1))*16 + hexToInt(s.charAt(i+2)));
i+=2;
continue;
}
baos.write(ch);
}
try {
return new String(baos.toByteArray(),"UTF-8");
} catch (UnsupportedEncodingException e) {
throw new Error(e); // impossible
}
}
代码示例来源:origin: jenkinsci/remoting
/**
* Decode '%HH'.
*/
private static String decode(String s) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
for( int i=0; i<s.length();i++ ) {
char ch = s.charAt(i);
if(ch=='%') {
baos.write(hexToInt(s.charAt(i+1))*16 + hexToInt(s.charAt(i+2)));
i+=2;
continue;
}
baos.write(ch);
}
try {
return new String(baos.toByteArray(),"UTF-8");
} catch (UnsupportedEncodingException e) {
throw new Error(e); // impossible
}
}
内容来源于网络,如有侵权,请联系作者删除!