OSDN Git Service

Improve DataSource interface.
authorAlex Klyubin <klyubin@google.com>
Fri, 27 May 2016 17:00:53 +0000 (10:00 -0700)
committerAlex Klyubin <klyubin@google.com>
Fri, 27 May 2016 17:28:52 +0000 (10:28 -0700)
commit7b977ea0e9580706799c7401375363d44135dddb
tree4517d3e2f429be059ca7c5be8d9c71a01daf556d
parent8ed91b66240d3071a42365737f4cd5c7dbe601e1
Improve DataSource interface.

1. This adds way to obtain a DataSource which represents a region of
   data contained in the DataSource.
2. This fixes a design bug in "feed" method where the size parameter
   was an int instead of long.
3. This fixes a bug in ByteBufferDataSource where its mSize field was
   a long instead of an int (ByteBuffer's length cannot be more than
   2^31).

Bug: 27461702
Change-Id: Ib0812784beb581f19d2412e667b8bd018f0a3c78
tools/apksigner/core/src/com/android/apksigner/core/internal/util/ByteBufferDataSource.java
tools/apksigner/core/src/com/android/apksigner/core/util/DataSource.java
tools/apksigner/core/src/com/android/apksigner/core/util/DataSources.java