Examples of pushLimit()


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

      while (!in.isAtEnd()) {
        int length = in.readRawVarint32();
        if (i < logSkip) {
          in.skipRawBytes(length);
        } else {
          int oldLimit = in.pushLimit(length);

          protobuf.clear();
          protobuf.mergeFrom(in);

          JobLogLine line = new JobLogLine();
View Full Code Here

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

    public static <T extends Message.Builder> T readToBuilder(DataInputStream input, T builder)
            throws IOException {
        int size = input.readInt();
        CodedInputStream codedIn = CodedInputStream.newInstance(input);
        codedIn.pushLimit(size);
        builder.mergeFrom(codedIn);
        return builder;
    }
}
View Full Code Here

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

        for (long i = 0; i < messageCount; i++) {
            watch2.start();

            int size = cin.readRawVarint32();
            int previous = cin.pushLimit(size);
            //cin.setSizeLimit(size + 4);
            OpenWire.Message message = OpenWire.Message.parseFrom(cin);
            cin.resetBytesReadCounter();
            cin.popLimit(previous);
View Full Code Here

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

        // now lets try read them!
        FileInputStream in = new FileInputStream(fileName);
        CodedInputStream cin = CodedInputStream.newInstance(in);
        for (int i = 0; i < messageCount; i++) {
            int size = cin.readRawVarint32();
            int previous = cin.pushLimit(size);
            OpenWire.Message message = OpenWire.Message.parseFrom(cin);
            cin.popLimit(previous);
            System.out.println("Reading message: " + i + " = " + message);

            assertEquals("message.getPersistent()", true, message.getPersistent());
View Full Code Here

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

            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
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.