diff options
Diffstat (limited to 'dx/src/com/android/dx/io/DexBuffer.java')
-rw-r--r-- | dx/src/com/android/dx/io/DexBuffer.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/dx/src/com/android/dx/io/DexBuffer.java b/dx/src/com/android/dx/io/DexBuffer.java index d10b08c55..85fbcb62e 100644 --- a/dx/src/com/android/dx/io/DexBuffer.java +++ b/dx/src/com/android/dx/io/DexBuffer.java @@ -304,10 +304,11 @@ public final class DexBuffer { private final String name; private int position; private final int limit; + private final int initialPosition; private Section(String name, int position, int limit) { this.name = name; - this.position = position; + this.position = this.initialPosition = position; this.limit = limit; } @@ -645,5 +646,12 @@ public final class DexBuffer { public int remaining() { return limit - position; } + + /** + * Returns the number of bytes used by this section. + */ + public int used () { + return position - initialPosition; + } } } |