Examples of writeRawVarint32()


Examples of com.google.protobuf.CodedOutputStream.writeRawVarint32()

        CodedOutputStream out = CodedOutputStream.newInstance(buf);
        SetRollupSize.update(buf.length);
        out.writeRawByte(Constants.VERSION_1_SET_ROLLUP);
        out.writeRawVarint32(rollup.getCount());
        for (Integer i : rollup.getHashes()) {
            out.writeRawVarint32(i);
        }
    }
   
    private static SetRollup deserializeV1SetRollup(CodedInputStream in) throws IOException {
        int count = in.readRawVarint32();
View Full Code Here

Examples of com.google.protobuf.CodedOutputStream.writeRawVarint32()

       
        // sum, count, countps, avg, max, min, var
        out.writeRawVarint64(rollup.getSum());
        out.writeRawVarint64(rollup.getCount());
        out.writeDoubleNoTag(rollup.getRate());
        out.writeRawVarint32(rollup.getSampleCount());
        putRollupStat(rollup.getAverage(), out);
        putRollupStat(rollup.getMaxValue(), out);
        putRollupStat(rollup.getMinValue(), out);
        putRollupStat(rollup.getVariance(), out);
       
View Full Code Here

Examples of com.google.protobuf.CodedOutputStream.writeRawVarint32()

        putRollupStat(rollup.getMinValue(), out);
        putRollupStat(rollup.getVariance(), out);
       
        // percentiles.
        Map<String, TimerRollup.Percentile> percentiles = rollup.getPercentiles();
        out.writeRawVarint32(percentiles.size());
        for (Map.Entry<String, TimerRollup.Percentile> entry : percentiles.entrySet()) {
            out.writeStringNoTag(entry.getKey());
            putUnversionedDoubleOrLong(entry.getValue().getMean(), out);
        }
    }
View Full Code Here

Examples of com.google.protobuf.CodedOutputStream.writeRawVarint32()

                ByteArrayOutputStream jsonBuf = new ByteArrayOutputStream(contentLength);
                ReaderWriter.writeTo(in, jsonBuf);
                byte[] jsonBytes = jsonBuf.toByteArray();
               
                out.writeStringNoTag(request.getAbsolutePath().getPath());
                out.writeRawVarint32(Integer.parseInt(request.getHeaderValue("Content-Length")));
                out.writeRawBytes(jsonBytes);
                out.flush();
               
                buf.flip();
                // all of buf.remaining() is ready to be serialized.
View Full Code Here

Examples of com.google.protobuf.CodedOutputStream.writeRawVarint32()

   
    // returns a mutable buffer. you can damage these bytes!
    public static byte[] toBytes(Collection<Metric> metrics) throws IOException {
        AccessibleByteArrayOutputStream out = new AccessibleByteArrayOutputStream(UDPMetricSerialization.computeBinarySize(metrics));
        CodedOutputStream codedOut = CodedOutputStream.newInstance(out);
        codedOut.writeRawVarint32(metrics.size());
        for (Metric metric : metrics) {
            write(metric, codedOut);
        }
        codedOut.flush();
        out.close();
View Full Code Here

Examples of com.google.protobuf.CodedOutputStream.writeRawVarint32()

      ByteBuf buf = ctx.alloc().buffer();
      OutputStream os = new ByteBufOutputStream(buf);
      CodedOutputStream cos = CodedOutputStream.newInstance(os);

      // write full length first (this is length delimited stream).
      cos.writeRawVarint32(fullLength);

      // write header
      cos.writeRawVarint32(HEADER_TAG);
      cos.writeRawVarint32(headerLength);
      header.writeTo(cos);
View Full Code Here

Examples of com.google.protobuf.CodedOutputStream.writeRawVarint32()

      // write full length first (this is length delimited stream).
      cos.writeRawVarint32(fullLength);

      // write header
      cos.writeRawVarint32(HEADER_TAG);
      cos.writeRawVarint32(headerLength);
      header.writeTo(cos);

      // write protobuf body length and body
      cos.writeRawVarint32(PROTOBUF_BODY_TAG);
View Full Code Here

Examples of com.google.protobuf.CodedOutputStream.writeRawVarint32()

      // write full length first (this is length delimited stream).
      cos.writeRawVarint32(fullLength);

      // write header
      cos.writeRawVarint32(HEADER_TAG);
      cos.writeRawVarint32(headerLength);
      header.writeTo(cos);

      // write protobuf body length and body
      cos.writeRawVarint32(PROTOBUF_BODY_TAG);
      cos.writeRawVarint32(protoBodyLength);
View Full Code Here

Examples of com.google.protobuf.CodedOutputStream.writeRawVarint32()

      cos.writeRawVarint32(HEADER_TAG);
      cos.writeRawVarint32(headerLength);
      header.writeTo(cos);

      // write protobuf body length and body
      cos.writeRawVarint32(PROTOBUF_BODY_TAG);
      cos.writeRawVarint32(protoBodyLength);
      msg.pBody.writeTo(cos);

      // if exists, write data body and tag.
      if (msg.getRawBodySize() > 0) {
View Full Code Here

Examples of com.google.protobuf.CodedOutputStream.writeRawVarint32()

      cos.writeRawVarint32(headerLength);
      header.writeTo(cos);

      // write protobuf body length and body
      cos.writeRawVarint32(PROTOBUF_BODY_TAG);
      cos.writeRawVarint32(protoBodyLength);
      msg.pBody.writeTo(cos);

      // if exists, write data body and tag.
      if (msg.getRawBodySize() > 0) {
        if(RpcConstants.EXTRA_DEBUGGING) {
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.