diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2010-07-06 19:38:39 -0700 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2010-07-06 19:41:06 -0700 |
commit | f29741d1d86ea9baa7a37545da29be38a9d1af02 (patch) | |
tree | af519501c8d1b2076c20d118972fa089e6c0d86e /org.eclipse.jgit | |
parent | ab3c68c512035a87071da3269ce8810b55b52b3f (diff) | |
download | jgit-f29741d1d86ea9baa7a37545da29be38a9d1af02.tar.gz jgit-f29741d1d86ea9baa7a37545da29be38a9d1af02.zip |
amend commit: Support large delta packed objects as streams
Rename the ByteWindow's inflate() method to setInput. We have
completely refactored the purpose of this method to be feeding part
(or all) of the window as input to the Inflater, and the actual
inflate activity happens in the caller.
Change-Id: Ie93a5bae0e9e637b5e822d56993ce6b562c6ad15
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit')
4 files changed, 7 insertions, 7 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ByteArrayWindow.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ByteArrayWindow.java index 0e85c58dc2..457c8dc90a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ByteArrayWindow.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ByteArrayWindow.java @@ -70,7 +70,7 @@ final class ByteArrayWindow extends ByteWindow { } @Override - protected int inflate(final int pos, final Inflater inf) + protected int setInput(final int pos, final Inflater inf) throws DataFormatException { int n = array.length - pos; inf.setInput(array, pos, n); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ByteBufferWindow.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ByteBufferWindow.java index c6308cc1d7..29a0159950 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ByteBufferWindow.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ByteBufferWindow.java @@ -72,7 +72,7 @@ final class ByteBufferWindow extends ByteWindow { } @Override - protected int inflate(final int pos, final Inflater inf) + protected int setInput(final int pos, final Inflater inf) throws DataFormatException { final ByteBuffer s = buffer.slice(); s.position(pos); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ByteWindow.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ByteWindow.java index e95dfd30f7..f92efb4ac9 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ByteWindow.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ByteWindow.java @@ -117,10 +117,10 @@ abstract class ByteWindow { */ protected abstract int copy(int pos, byte[] dstbuf, int dstoff, int cnt); - final int inflate(long pos, Inflater inf) throws DataFormatException { - return inflate((int) (pos - start), inf); + final int setInput(long pos, Inflater inf) throws DataFormatException { + return setInput((int) (pos - start), inf); } - protected abstract int inflate(int pos, Inflater inf) + protected abstract int setInput(int pos, Inflater inf) throws DataFormatException; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCursor.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCursor.java index 33ca006e7c..6f4e72a82f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCursor.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCursor.java @@ -171,13 +171,13 @@ final class WindowCursor extends ObjectReader implements ObjectReuseAsIs { int dstoff) throws IOException, DataFormatException { prepareInflater(); pin(pack, position); - position += window.inflate(position, inf); + position += window.setInput(position, inf); do { int n = inf.inflate(dstbuf, dstoff, dstbuf.length - dstoff); if (n == 0) { if (inf.needsInput()) { pin(pack, position); - position += window.inflate(position, inf); + position += window.setInput(position, inf); } else if (inf.finished()) return dstoff; else |