Package com.google.protobuf

Examples of com.google.protobuf.CodedInputStream.readRawVarint32()


          md = this.service.getDescriptorForType().findMethodByName(header.getMethodName());
          if (md == null) throw new UnsupportedOperationException(header.getMethodName());
          Builder builder = this.service.getRequestPrototype(md).newBuilderForType();
          // To read the varint, I need an inputstream; might as well be a CIS.
          cis = CodedInputStream.newInstance(buf, offset, buf.length);
          int paramSize = cis.readRawVarint32();
          offset += cis.getTotalBytesRead();
          if (builder != null) {
            param = builder.mergeFrom(buf, offset, paramSize).build();
          }
          offset += paramSize;
View Full Code Here


        byte[] buf = new byte[bb.readableBytes()];
       
        bb.readBytes(buf);
       
        CodedInputStream in = CodedInputStream.newInstance(buf);
        final int numMetrics = in.readRawVarint32();
        List<Metric> metrics = new ArrayList<Metric>(numMetrics);
       
        for (int i = 0; i < numMetrics; i++) {
       
            String tenantId = in.readString();
View Full Code Here

       
            String tenantId = in.readString();
            String metricName = in.readString();
            DataType type = new DataType(in.readString());
            long collectionTime = in.readRawVarint64();
            int ttlSecs = in.readRawVarint32();
            String units = in.readString();
            Object value = null;
            if (type.equals(DataType.BOOLEAN))
                value = in.readBool();
            else if (type.equals(DataType.DOUBLE))
View Full Code Here

            if (type.equals(DataType.BOOLEAN))
                value = in.readBool();
            else if (type.equals(DataType.DOUBLE))
                value = in.readDouble();
            else if (type.equals(DataType.INT))
                value = in.readRawVarint32();
            else if (type.equals(DataType.LONG))
                value = in.readRawVarint64();
            else if (type.equals(DataType.STRING))
                value = in.readString();
           
View Full Code Here

      for (;;) {
        switch (WireFormat.getTagFieldNumber(tag)) {
        case 0:
          return members;
        case 1: {
          int cnt = in.readRawVarint32();
          int ptr = in.getTotalBytesRead();
          members.setChunkData(raw, ptr, cnt);
          in.skipRawBytes(cnt);
          tag = in.readTag();
          if (WireFormat.getTagFieldNumber(tag) != 2)
View Full Code Here

          if (WireFormat.getTagFieldNumber(tag) != 2)
            continue;
        }
        //$FALL-THROUGH$
        case 2: {
          int cnt = in.readRawVarint32();
          int ptr = in.getTotalBytesRead();
          members.setChunkIndex(raw, ptr, cnt);
          in.skipRawBytes(cnt);
          tag = in.readTag();
          if (WireFormat.getTagFieldNumber(tag) != 3)
View Full Code Here

          if (WireFormat.getTagFieldNumber(tag) != 3)
            continue;
        }
        //$FALL-THROUGH$
        case 3: {
          int cnt = in.readRawVarint32();
          int oldLimit = in.pushLimit(cnt);
          members.setMeta(ChunkMeta.parseFrom(in));
          in.popLimit(oldLimit);
          tag = in.readTag();
          continue;
View Full Code Here

      CodedInputStream clhs = CodedInputStream.newInstance(lhs);
      CodedInputStream crhs = CodedInputStream.newInstance(rhs);

      try {
        int lhsLen = clhs.readRawVarint32();
        int rhsLen = crhs.readRawVarint32();
        return WritableComparator.compareBytes(lhs.getBuffer(), lhs.getPosition(), lhsLen, rhs.getBuffer(), rhs.getPosition(), rhsLen);
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.