hudson.remoting.Which.hexToInt()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(146)

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

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
  }
}

相关文章