com.google.protobuf.ByteString.iterator()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(135)

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

ByteString.iterator介绍

[英]Return a ByteString.ByteIterator over the bytes in the ByteString. To avoid auto-boxing, you may get the iterator manually and call ByteIterator#nextByte().
[中]返回一个ByteString。ByteString中字节上的ByteIterator。为了避免自动装箱,您可以手动获取迭代器并调用ByteIterator#nextByte()。

代码示例

代码示例来源:origin: googleapis/google-cloud-java

@Override
public final Iterator<Byte> iterator() {
 return byteString.iterator();
}

代码示例来源:origin: googleapis/google-cloud-java

/** Converts the value to a quoted regular expression. */
public static ByteString literalRegex(ByteString value) {
 ByteString.Output output = ByteString.newOutput(value.size() * 2);
 ByteIterator it = value.iterator();
 writeLiteralRegex(it, output);
 return output.toByteString();
}

代码示例来源:origin: MovingBlocks/Terasology

private static TeraArray runLengthDecode(EntityData.RunLengthEncoding8 data) {
  Preconditions.checkState(data.getValues().size() == data.getRunLengthsCount(), "Expected same number of values as runs");
  byte[] decodedData = new byte[ChunkConstants.SIZE_X * ChunkConstants.SIZE_Y * ChunkConstants.SIZE_Z];
  int index = 0;
  ByteString.ByteIterator valueSource = data.getValues().iterator();
  for (int pos = 0; pos < data.getRunLengthsCount(); ++pos) {
    int length = data.getRunLengths(pos);
    byte value = valueSource.nextByte();
    for (int i = 0; i < length; ++i) {
      decodedData[index++] = value;
    }
  }
  return new TeraDenseArray8Bit(ChunkConstants.SIZE_X, ChunkConstants.SIZE_Y, ChunkConstants.SIZE_Z, decodedData);
}

代码示例来源:origin: org.symphonyoss.s2.common/S2-common-core

@Override
public Iterator<Byte> iterator()
{
 return byteString_.iterator();
}

代码示例来源:origin: com.google.cloud/gcloud-java-core

@Override
public final Iterator<Byte> iterator() {
 return byteString.iterator();
}

代码示例来源:origin: com.google.cloud/google-cloud-core

@Override
public final Iterator<Byte> iterator() {
 return byteString.iterator();
}

代码示例来源:origin: GoogleCloudPlatform/cloud-bigtable-client

/** Converts the value to a quoted regular expression. */
public static ByteString literalRegex(ByteString value) {
 Output output = ByteString.newOutput(value.size() * 2);
 ByteIterator it = value.iterator();
 try {
  writeLiteralRegex(it, output);
 } catch (IOException e) {
  throw new RuntimeException("Unexpected io error converting regex", e);
 }
 return output.toByteString();
}

代码示例来源:origin: com.google.cloud/google-cloud-bigtable

/** Converts the value to a quoted regular expression. */
public static ByteString literalRegex(ByteString value) {
 ByteString.Output output = ByteString.newOutput(value.size() * 2);
 ByteIterator it = value.iterator();
 writeLiteralRegex(it, output);
 return output.toByteString();
}

相关文章