okhttp3.internal.Util.decodeHexDigit()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(173)

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

Util.decodeHexDigit介绍

暂无

代码示例

代码示例来源:origin: square/okhttp

static boolean percentEncoded(String encoded, int pos, int limit) {
 return pos + 2 < limit
   && encoded.charAt(pos) == '%'
   && decodeHexDigit(encoded.charAt(pos + 1)) != -1
   && decodeHexDigit(encoded.charAt(pos + 2)) != -1;
}

代码示例来源:origin: com.squareup.okhttp3/okhttp

static boolean percentEncoded(String encoded, int pos, int limit) {
 return pos + 2 < limit
   && encoded.charAt(pos) == '%'
   && decodeHexDigit(encoded.charAt(pos + 1)) != -1
   && decodeHexDigit(encoded.charAt(pos + 2)) != -1;
}

代码示例来源:origin: square/okhttp

static void percentDecode(Buffer out, String encoded, int pos, int limit, boolean plusIsSpace) {
 int codePoint;
 for (int i = pos; i < limit; i += Character.charCount(codePoint)) {
  codePoint = encoded.codePointAt(i);
  if (codePoint == '%' && i + 2 < limit) {
   int d1 = decodeHexDigit(encoded.charAt(i + 1));
   int d2 = decodeHexDigit(encoded.charAt(i + 2));
   if (d1 != -1 && d2 != -1) {
    out.writeByte((d1 << 4) + d2);
    i += 2;
    continue;
   }
  } else if (codePoint == '+' && plusIsSpace) {
   out.writeByte(' ');
   continue;
  }
  out.writeUtf8CodePoint(codePoint);
 }
}

代码示例来源:origin: square/okhttp

for (; i < limit; i++) {
 char c = input.charAt(i);
 int hexDigit = decodeHexDigit(c);
 if (hexDigit == -1) break;
 value = (value << 4) + hexDigit;

代码示例来源:origin: com.squareup.okhttp3/okhttp

static void percentDecode(Buffer out, String encoded, int pos, int limit, boolean plusIsSpace) {
 int codePoint;
 for (int i = pos; i < limit; i += Character.charCount(codePoint)) {
  codePoint = encoded.codePointAt(i);
  if (codePoint == '%' && i + 2 < limit) {
   int d1 = decodeHexDigit(encoded.charAt(i + 1));
   int d2 = decodeHexDigit(encoded.charAt(i + 2));
   if (d1 != -1 && d2 != -1) {
    out.writeByte((d1 << 4) + d2);
    i += 2;
    continue;
   }
  } else if (codePoint == '+' && plusIsSpace) {
   out.writeByte(' ');
   continue;
  }
  out.writeUtf8CodePoint(codePoint);
 }
}

代码示例来源:origin: com.squareup.okhttp3/okhttp

for (; i < limit; i++) {
 char c = input.charAt(i);
 int hexDigit = decodeHexDigit(c);
 if (hexDigit == -1) break;
 value = (value << 4) + hexDigit;

代码示例来源:origin: com.github.ljun20160606/okhttp

static boolean percentEncoded(String encoded, int pos, int limit) {
 return pos + 2 < limit
   && encoded.charAt(pos) == '%'
   && decodeHexDigit(encoded.charAt(pos + 1)) != -1
   && decodeHexDigit(encoded.charAt(pos + 2)) != -1;
}

代码示例来源:origin: apache/servicemix-bundles

static boolean percentEncoded(String encoded, int pos, int limit) {
 return pos + 2 < limit
   && encoded.charAt(pos) == '%'
   && decodeHexDigit(encoded.charAt(pos + 1)) != -1
   && decodeHexDigit(encoded.charAt(pos + 2)) != -1;
}

代码示例来源:origin: com.github.ljun20160606/okhttp

static void percentDecode(Buffer out, String encoded, int pos, int limit, boolean plusIsSpace) {
 int codePoint;
 for (int i = pos; i < limit; i += Character.charCount(codePoint)) {
  codePoint = encoded.codePointAt(i);
  if (codePoint == '%' && i + 2 < limit) {
   int d1 = decodeHexDigit(encoded.charAt(i + 1));
   int d2 = decodeHexDigit(encoded.charAt(i + 2));
   if (d1 != -1 && d2 != -1) {
    out.writeByte((d1 << 4) + d2);
    i += 2;
    continue;
   }
  } else if (codePoint == '+' && plusIsSpace) {
   out.writeByte(' ');
   continue;
  }
  out.writeUtf8CodePoint(codePoint);
 }
}

代码示例来源:origin: apache/servicemix-bundles

static void percentDecode(Buffer out, String encoded, int pos, int limit, boolean plusIsSpace) {
 int codePoint;
 for (int i = pos; i < limit; i += Character.charCount(codePoint)) {
  codePoint = encoded.codePointAt(i);
  if (codePoint == '%' && i + 2 < limit) {
   int d1 = decodeHexDigit(encoded.charAt(i + 1));
   int d2 = decodeHexDigit(encoded.charAt(i + 2));
   if (d1 != -1 && d2 != -1) {
    out.writeByte((d1 << 4) + d2);
    i += 2;
    continue;
   }
  } else if (codePoint == '+' && plusIsSpace) {
   out.writeByte(' ');
   continue;
  }
  out.writeUtf8CodePoint(codePoint);
 }
}

代码示例来源:origin: com.github.ljun20160606/okhttp

for (; i < limit; i++) {
 char c = input.charAt(i);
 int hexDigit = decodeHexDigit(c);
 if (hexDigit == -1) break;
 value = (value << 4) + hexDigit;

代码示例来源:origin: apache/servicemix-bundles

for (; i < limit; i++) {
 char c = input.charAt(i);
 int hexDigit = decodeHexDigit(c);
 if (hexDigit == -1) break;
 value = (value << 4) + hexDigit;

相关文章