Package com.google.protobuf

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


      int tag;
      while ((tag = in.readTag()) != 0) {
         readTags++;
         switch (tag) {
            case wrappedDescriptorFullName << 3 | WireFormat.WIRETYPE_LENGTH_DELIMITED:
               descriptorFullName = in.readString();
               break;
            case wrappedEnum << 3 | WireFormat.WIRETYPE_VARINT:
               enumValue = in.readEnum();
               break;
            case wrappedMessageBytes << 3 | WireFormat.WIRETYPE_LENGTH_DELIMITED:
View Full Code Here


               break;
            case wrappedMessageBytes << 3 | WireFormat.WIRETYPE_LENGTH_DELIMITED:
               messageBytes = in.readBytes().toByteArray();
               break;
            case wrappedString << 3 | WireFormat.WIRETYPE_LENGTH_DELIMITED:
               value = in.readString();
               break;
            case wrappedBytes << 3 | WireFormat.WIRETYPE_LENGTH_DELIMITED:
               value = in.readBytes().toByteArray();
               break;
            case wrappedBool << 3 | WireFormat.WIRETYPE_VARINT:
View Full Code Here

    public String fromByteBuffer(ByteBuffer byteBuffer) {
        CodedInputStream is = CodedInputStream.newInstance(byteBuffer.array());
        try {
            byte type = is.readRawByte();
            if (type == STRING) {
                return is.readString();
            } else {
                throw new IOException("Unexpected first byte. Expected '4' (string). Got '" + type + "'.");
            }
        } catch (IOException e) {
            throw new RuntimeException("IOException during deserialization", e);
View Full Code Here

        final int numMetrics = in.readRawVarint32();
        List<Metric> metrics = new ArrayList<Metric>(numMetrics);
       
        for (int i = 0; i < numMetrics; i++) {
       
            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();
View Full Code Here

        List<Metric> metrics = new ArrayList<Metric>(numMetrics);
       
        for (int i = 0; i < numMetrics; i++) {
       
            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;
View Full Code Here

       
        for (int i = 0; i < numMetrics; i++) {
       
            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))
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))
                value = in.readDouble();
View Full Code Here

            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();
           
            if (value != null) {
                metrics.add(new Metric(
                        Locator.createLocatorFromPathComponents(tenantId, metricName),
                        value,
View Full Code Here

               case FLOAT:
                  return in.readFloat();
               case BOOL:
                  return in.readBool();
               case STRING:
                  return in.readString();
               case BYTES:
                  return in.readBytes().toByteArray();
               case INT32:
                  return in.readInt32();
               case SFIXED32:
View Full Code Here

      int tag;
      while ((tag = in.readTag()) != 0) {
         readTags++;
         switch (tag) {
            case wrappedDescriptorFullName << 3 | WireFormat.WIRETYPE_LENGTH_DELIMITED:
               descriptorFullName = in.readString();
               break;
            case wrappedEnum << 3 | WireFormat.WIRETYPE_VARINT:
               enumValue = in.readEnum();
               break;
            case wrappedMessageBytes << 3 | WireFormat.WIRETYPE_LENGTH_DELIMITED:
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.