com.google.common.base.Utf8.isWellFormedSlowPath()方法的使用及代码示例

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

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

Utf8.isWellFormedSlowPath介绍

暂无

代码示例

代码示例来源:origin: google/guava

/**
 * Returns whether the given byte array slice is a well-formed UTF-8 byte sequence, as defined by
 * {@link #isWellFormed(byte[])}. Note that this can be false even when {@code
 * isWellFormed(bytes)} is true.
 *
 * @param bytes the input buffer
 * @param off the offset in the buffer of the first byte to read
 * @param len the number of bytes to read from the buffer
 */
public static boolean isWellFormed(byte[] bytes, int off, int len) {
 int end = off + len;
 checkPositionIndexes(off, end, bytes.length);
 // Look for the first non-ASCII character.
 for (int i = off; i < end; i++) {
  if (bytes[i] < 0) {
   return isWellFormedSlowPath(bytes, i, end);
  }
 }
 return true;
}

代码示例来源:origin: google/j2objc

/**
 * Returns whether the given byte array slice is a well-formed UTF-8 byte sequence, as defined by
 * {@link #isWellFormed(byte[])}. Note that this can be false even when {@code
 * isWellFormed(bytes)} is true.
 *
 * @param bytes the input buffer
 * @param off the offset in the buffer of the first byte to read
 * @param len the number of bytes to read from the buffer
 */
public static boolean isWellFormed(byte[] bytes, int off, int len) {
 int end = off + len;
 checkPositionIndexes(off, end, bytes.length);
 // Look for the first non-ASCII character.
 for (int i = off; i < end; i++) {
  if (bytes[i] < 0) {
   return isWellFormedSlowPath(bytes, i, end);
  }
 }
 return true;
}

代码示例来源:origin: wildfly/wildfly

/**
 * Returns whether the given byte array slice is a well-formed UTF-8 byte sequence, as defined by
 * {@link #isWellFormed(byte[])}. Note that this can be false even when {@code
 * isWellFormed(bytes)} is true.
 *
 * @param bytes the input buffer
 * @param off the offset in the buffer of the first byte to read
 * @param len the number of bytes to read from the buffer
 */
public static boolean isWellFormed(byte[] bytes, int off, int len) {
 int end = off + len;
 checkPositionIndexes(off, end, bytes.length);
 // Look for the first non-ASCII character.
 for (int i = off; i < end; i++) {
  if (bytes[i] < 0) {
   return isWellFormedSlowPath(bytes, i, end);
  }
 }
 return true;
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

/**
 * Returns whether the given byte array slice is a well-formed UTF-8 byte sequence, as defined by
 * {@link #isWellFormed(byte[])}. Note that this can be false even when {@code
 * isWellFormed(bytes)} is true.
 *
 * @param bytes the input buffer
 * @param off the offset in the buffer of the first byte to read
 * @param len the number of bytes to read from the buffer
 */
public static boolean isWellFormed(byte[] bytes, int off, int len) {
 int end = off + len;
 checkPositionIndexes(off, end, bytes.length);
 // Look for the first non-ASCII character.
 for (int i = off; i < end; i++) {
  if (bytes[i] < 0) {
   return isWellFormedSlowPath(bytes, i, end);
  }
 }
 return true;
}

代码示例来源:origin: com.google.guava/guava-jdk5

/**
 * Returns whether the given byte array slice is a well-formed UTF-8 byte sequence, as defined by
 * {@link #isWellFormed(byte[])}. Note that this can be false even when {@code
 * isWellFormed(bytes)} is true.
 *
 * @param bytes the input buffer
 * @param off the offset in the buffer of the first byte to read
 * @param len the number of bytes to read from the buffer
 */
public static boolean isWellFormed(byte[] bytes, int off, int len) {
 int end = off + len;
 checkPositionIndexes(off, end, bytes.length);
 // Look for the first non-ASCII character.
 for (int i = off; i < end; i++) {
  if (bytes[i] < 0) {
   return isWellFormedSlowPath(bytes, i, end);
  }
 }
 return true;
}

代码示例来源:origin: com.diffplug.guava/guava-core

/**
 * Returns whether the given byte array slice is a well-formed UTF-8 byte sequence, as defined by
 * {@link #isWellFormed(byte[])}. Note that this can be false even when {@code
 * isWellFormed(bytes)} is true.
 *
 * @param bytes the input buffer
 * @param off the offset in the buffer of the first byte to read
 * @param len the number of bytes to read from the buffer
 */
@CheckReturnValue
public static boolean isWellFormed(byte[] bytes, int off, int len) {
  int end = off + len;
  checkPositionIndexes(off, end, bytes.length);
  // Look for the first non-ASCII character.
  for (int i = off; i < end; i++) {
    if (bytes[i] < 0) {
      return isWellFormedSlowPath(bytes, i, end);
    }
  }
  return true;
}

代码示例来源:origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

/**
 * Returns whether the given byte array slice is a well-formed UTF-8 byte sequence, as defined by
 * {@link #isWellFormed(byte[])}. Note that this can be false even when {@code
 * isWellFormed(bytes)} is true.
 *
 * @param bytes the input buffer
 * @param off the offset in the buffer of the first byte to read
 * @param len the number of bytes to read from the buffer
 */
public static boolean isWellFormed(byte[] bytes, int off, int len) {
 int end = off + len;
 checkPositionIndexes(off, end, bytes.length);
 // Look for the first non-ASCII character.
 for (int i = off; i < end; i++) {
  if (bytes[i] < 0) {
   return isWellFormedSlowPath(bytes, i, end);
  }
 }
 return true;
}

代码示例来源:origin: Nextdoor/bender

/**
 * Returns whether the given byte array slice is a well-formed UTF-8 byte sequence, as defined by
 * {@link #isWellFormed(byte[])}. Note that this can be false even when {@code
 * isWellFormed(bytes)} is true.
 *
 * @param bytes the input buffer
 * @param off the offset in the buffer of the first byte to read
 * @param len the number of bytes to read from the buffer
 */
public static boolean isWellFormed(byte[] bytes, int off, int len) {
 int end = off + len;
 checkPositionIndexes(off, end, bytes.length);
 // Look for the first non-ASCII character.
 for (int i = off; i < end; i++) {
  if (bytes[i] < 0) {
   return isWellFormedSlowPath(bytes, i, end);
  }
 }
 return true;
}

相关文章