~ubuntu-branches/debian/experimental/protobuf/experimental

« back to all changes in this revision

Viewing changes to java/src/main/java/com/google/protobuf/CodedInputStream.java

  • Committer: Package Import Robot
  • Author(s): Robert S. Edmonds, Micah Anderson, Colin Watson, Steve Langasek, Robert S. Edmonds
  • Date: 2013-10-12 18:32:37 UTC
  • mfrom: (1.3.1) (10.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20131012183237-jz6tvmj9tn68atrf
Tags: 2.5.0-1
[ Micah Anderson ]
* New upstream version. (Closes: #704731.)
* Update debian/watch.
* Refresh patches.

[ Colin Watson ]
* Use the autotools-dev dh addon to update config.guess/config.sub for
  arm64. (Closes: #725976.)

[ Steve Langasek ]
* Don't recommend protobuf-compiler from the bindings, it's not used and
  this doesn't need to be pulled in at runtime. (Closes: #703628.)
* Mark protobuf-compiler Multi-Arch: foreign; the output of this command
  is architecture-independent source, we don't need the version of the
  compiler to match the target arch.
* Bump to debhelper compat 9, so that our libs get installed to the
  multiarch locations.
* Mark the library packages Multi-Arch: same.
* Fix debian/rules to support cross-building of the python bindings.
* Build-depend on libpython-dev, not python-dev, for cross-build
  compatibility.
* (Closes: #726083.)

[ Robert S. Edmonds ]
* Upload to experimental.
* Bump ABI version from 7 to 8.
* Bump Standards-Version to 3.9.4.
* Convert from python-support to dh-python.
* Drop support for python2.6.
* python-protobuf: switch back to the pure Python implementation, as
  upstream appears to no longer be maintaining the current C++ based Python
  binding. See the following upstream issues for details:
  - https://code.google.com/p/protobuf/issues/detail?id=434
  - https://code.google.com/p/protobuf/issues/detail?id=503

Show diffs side-by-side

added added

removed removed

Lines of Context:
243
243
    --recursionDepth;
244
244
  }
245
245
 
 
246
  /** Read a {@code group} field value from the stream. */
 
247
  public <T extends MessageLite> T readGroup(
 
248
      final int fieldNumber,
 
249
      final Parser<T> parser,
 
250
      final ExtensionRegistryLite extensionRegistry)
 
251
      throws IOException {
 
252
    if (recursionDepth >= recursionLimit) {
 
253
      throw InvalidProtocolBufferException.recursionLimitExceeded();
 
254
    }
 
255
    ++recursionDepth;
 
256
    T result = parser.parsePartialFrom(this, extensionRegistry);
 
257
    checkLastTagWas(
 
258
      WireFormat.makeTag(fieldNumber, WireFormat.WIRETYPE_END_GROUP));
 
259
    --recursionDepth;
 
260
    return result;
 
261
  }
 
262
 
246
263
  /**
247
264
   * Reads a {@code group} field value from the stream and merges it into the
248
265
   * given {@link UnknownFieldSet}.
278
295
    popLimit(oldLimit);
279
296
  }
280
297
 
 
298
  /** Read an embedded message field value from the stream. */
 
299
  public <T extends MessageLite> T readMessage(
 
300
      final Parser<T> parser,
 
301
      final ExtensionRegistryLite extensionRegistry)
 
302
      throws IOException {
 
303
    int length = readRawVarint32();
 
304
    if (recursionDepth >= recursionLimit) {
 
305
      throw InvalidProtocolBufferException.recursionLimitExceeded();
 
306
    }
 
307
    final int oldLimit = pushLimit(length);
 
308
    ++recursionDepth;
 
309
    T result = parser.parsePartialFrom(this, extensionRegistry);
 
310
    checkLastTagWas(0);
 
311
    --recursionDepth;
 
312
    popLimit(oldLimit);
 
313
    return result;
 
314
  }
 
315
 
281
316
  /** Read a {@code bytes} field value from the stream. */
282
317
  public ByteString readBytes() throws IOException {
283
318
    final int size = readRawVarint32();
601
636
   * refreshing its buffer.  If you need to prevent reading past a certain
602
637
   * point in the underlying {@code InputStream} (e.g. because you expect it to
603
638
   * contain more data after the end of the message which you need to handle
604
 
   * differently) then you must place a wrapper around you {@code InputStream}
 
639
   * differently) then you must place a wrapper around your {@code InputStream}
605
640
   * which limits the amount of data that can be read from it.
606
641
   *
607
642
   * @return the old limit.
676
711
 
677
712
  /**
678
713
   * Called with {@code this.buffer} is empty to read more bytes from the
679
 
   * input.  If {@code mustSucceed} is true, refillBuffer() gurantees that
 
714
   * input.  If {@code mustSucceed} is true, refillBuffer() guarantees that
680
715
   * either there will be at least one byte in the buffer when it returns
681
716
   * or it will throw an exception.  If {@code mustSucceed} is false,
682
717
   * refillBuffer() returns false if no more bytes were available.
879
914
        refillBuffer(true);
880
915
      }
881
916
 
882
 
      bufferPos = size - pos; 
 
917
      bufferPos = size - pos;
883
918
    }
884
919
  }
885
920
}