gpt4 book ai didi

com.google.protobuf.nano.WireFormatNano类的使用及代码示例

转载 作者:知者 更新时间:2024-03-25 08:31:05 25 4
gpt4 key购买 nike

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

WireFormatNano介绍

[英]This class is used internally by the Protocol Buffer library and generated message implementations. It is public only because those generated messages do not reside in the protobuf package. Others should not use this class directly. This class contains constants and helper functions useful for dealing with the Protocol Buffer wire format.
[中]该类由协议缓冲库和生成的消息实现在内部使用。它是公共的,只是因为这些生成的消息不在protobuf包中。其他人不应该直接使用这个类。此类包含常量和帮助函数,可用于处理协议缓冲区连线格式。

代码示例

代码示例来源:origin: IvanVolosyuk/diskusage

@Override
public LegacyScan mergeFrom(
    com.google.protobuf.nano.CodedInputByteBufferNano input)
  throws java.io.IOException {
 while (true) {
  int tag = input.readTag();
  switch (tag) {
   case 0:
    return this;
   default: {
    if (!com.google.protobuf.nano.WireFormatNano.parseUnknownField(input, tag)) {
     return this;
    }
    break;
   }
   case 10: {
    this.path = input.readString();
    break;
   }
  }
 }
}

代码示例来源:origin: IvanVolosyuk/diskusage

switch (WireFormatNano.getTagWireType(tag)) {
 case WireFormatNano.WIRETYPE_VARINT:
  readInt32();
  skipMessage();
  checkLastTagWas(
   WireFormatNano.makeTag(WireFormatNano.getTagFieldNumber(tag),
             WireFormatNano.WIRETYPE_END_GROUP));
  return true;

代码示例来源:origin: Doctoror/PainlessMusicPlayer

return this;
default: {
 if (!com.google.protobuf.nano.WireFormatNano.parseUnknownField(input, tag)) {
  return this;
   .getRepeatedFieldArrayLength(input, 10);
 int i = this.queue == null ? 0 : this.queue.length;
 PlaybackDataProto.Media[] newArray =

代码示例来源:origin: no.ecc.vectortile/java-vector-tile

.getRepeatedFieldArrayLength(input, 26);
int i = this.layers == null ? 0 : this.layers.length;
vector_tile.VectorTile.Tile.Layer[] newArray =

代码示例来源:origin: IvanVolosyuk/diskusage

/**
 * Checks if there is a value stored for the specified extension in this
 * message.
 */
public final boolean hasExtension(Extension<M, ?> extension) {
  if (unknownFieldData == null) {
    return false;
  }
  FieldData field = unknownFieldData.get(WireFormatNano.getTagFieldNumber(extension.tag));
  return field != null;
}

代码示例来源:origin: IvanVolosyuk/diskusage

/** Encode and write a tag. */
public void writeTag(final int fieldNumber, final int wireType)
           throws IOException {
 writeRawVarint32(WireFormatNano.makeTag(fieldNumber, wireType));
}

代码示例来源:origin: WeAreFairphone/FP2-Launcher

return this;
default: {
 if (!com.google.protobuf.nano.WireFormatNano.parseUnknownField(input, tag)) {
  return this;
   .getRepeatedFieldArrayLength(input, PROTO_42);
 int i = this.key == null ? 0 : this.key.length;
 com.fairphone.fplauncher3.backup.BackupProtos.Key[] newArray =

代码示例来源:origin: no.ecc.vectortile/java-vector-tile

.getRepeatedFieldArrayLength(input, 18);
int i = this.features == null ? 0 : this.features.length;
vector_tile.VectorTile.Tile.Feature[] newArray =
  .getRepeatedFieldArrayLength(input, 26);
int i = this.keys == null ? 0 : this.keys.length;
java.lang.String[] newArray = new java.lang.String[i + arrayLength];
  .getRepeatedFieldArrayLength(input, 34);
int i = this.values == null ? 0 : this.values.length;
vector_tile.VectorTile.Tile.Value[] newArray =

代码示例来源:origin: IvanVolosyuk/diskusage

protected int computeSingularSerializedSize(Object value) {
  // This implementation is for message/group extensions.
  int fieldNumber = WireFormatNano.getTagFieldNumber(tag);
  switch (type) {
    case TYPE_GROUP:
      MessageNano groupValue = (MessageNano) value;
      return CodedOutputByteBufferNano.computeGroupSize(fieldNumber, groupValue);
    case TYPE_MESSAGE:
      MessageNano messageValue = (MessageNano) value;
      return CodedOutputByteBufferNano.computeMessageSize(fieldNumber, messageValue);
    default:
      throw new IllegalArgumentException("Unknown type " + type);
  }
}

代码示例来源:origin: WeAreFairphone/FP2-Launcher

/** Encode and write a tag. */
public void writeTag(final int fieldNumber, final int wireType)
           throws IOException {
 writeRawVarint32(WireFormatNano.makeTag(fieldNumber, wireType));
}

代码示例来源:origin: klinker24/Android-Blur-Launcher

return this;
default: {
 if (!com.google.protobuf.nano.WireFormatNano.parseUnknownField(input, tag)) {
  return this;
   .getRepeatedFieldArrayLength(input, 42);
 int i = this.key == null ? 0 : this.key.length;
 BackupProtos.Key[] newArray =

代码示例来源:origin: IvanVolosyuk/diskusage

@Override
public StringValueProto mergeFrom(
    com.google.protobuf.nano.CodedInputByteBufferNano input)
  throws java.io.IOException {
 while (true) {
  int tag = input.readTag();
  switch (tag) {
   case 0:
    return this;
   default: {
    if (!com.google.protobuf.nano.WireFormatNano.parseUnknownField(input, tag)) {
     return this;
    }
    break;
   }
   case 10: {
    this.value = input.readString();
    break;
   }
  }
 }
}

代码示例来源:origin: no.ecc.vectortile/java-vector-tile

.getRepeatedFieldArrayLength(input, 16);
int i = this.tags == null ? 0 : this.tags.length;
int[] newArray = new int[i + arrayLength];
  .getRepeatedFieldArrayLength(input, 32);
int i = this.geometry == null ? 0 : this.geometry.length;
int[] newArray = new int[i + arrayLength];

代码示例来源:origin: WeAreFairphone/FP2-Launcher

switch (WireFormatNano.getTagWireType(tag)) {
 case WireFormatNano.WIRETYPE_VARINT:
  readInt32();
  skipMessage();
  checkLastTagWas(
   WireFormatNano.makeTag(WireFormatNano.getTagFieldNumber(tag),
             WireFormatNano.WIRETYPE_END_GROUP));
  return true;

代码示例来源:origin: WeAreFairphone/FP2-Launcher

protected int computeSingularSerializedSize(Object value) {
  // This implementation is for message/group extensions.
  int fieldNumber = WireFormatNano.getTagFieldNumber(tag);
  switch (type) {
    case TYPE_GROUP:
      MessageNano groupValue = (MessageNano) value;
      return CodedOutputByteBufferNano.computeGroupSize(fieldNumber, groupValue);
    case TYPE_MESSAGE:
      MessageNano messageValue = (MessageNano) value;
      return CodedOutputByteBufferNano.computeMessageSize(fieldNumber, messageValue);
    default:
      throw new IllegalArgumentException("Unknown type " + type);
  }
}

代码示例来源:origin: IvanVolosyuk/diskusage

/** Compute the number of bytes that would be needed to encode a tag. */
public static int computeTagSize(final int fieldNumber) {
 return computeRawVarint32Size(WireFormatNano.makeTag(fieldNumber, 0));
}

代码示例来源:origin: klinker24/launcher3

return this;
default: {
 if (!com.google.protobuf.nano.WireFormatNano.parseUnknownField(input, tag)) {
  return this;
   .getRepeatedFieldArrayLength(input, 42);
 int i = this.key == null ? 0 : this.key.length;
 com.android.launcher3.backup.BackupProtos.Key[] newArray =

代码示例来源:origin: klinker24/launcher3

@Override
public CheckedMessage mergeFrom(
    com.google.protobuf.nano.CodedInputByteBufferNano input)
  throws java.io.IOException {
 while (true) {
  int tag = input.readTag();
  switch (tag) {
   case 0:
    return this;
   default: {
    if (!com.google.protobuf.nano.WireFormatNano.parseUnknownField(input, tag)) {
     return this;
    }
    break;
   }
   case 10: {
    this.payload = input.readBytes();
    break;
   }
   case 16: {
    this.checksum = input.readInt64();
    break;
   }
  }
 }
}

代码示例来源:origin: WeAreFairphone/FP2-Launcher

/**
 * Gets the value stored in the specified extension of this message.
 */
public final <T> T getExtension(Extension<M, T> extension) {
  if (unknownFieldData == null) {
    return null;
  }
  FieldData field = unknownFieldData.get(WireFormatNano.getTagFieldNumber(extension.tag));
  return field == null ? null : field.getValue(extension);
}

代码示例来源:origin: WeAreFairphone/FP2-Launcher

/** Compute the number of bytes that would be needed to encode a tag. */
public static int computeTagSize(final int fieldNumber) {
 return computeRawVarint32Size(WireFormatNano.makeTag(fieldNumber, 0));
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com