]> source.dussan.org Git - jgit.git/commit
Add brute force byte array loading to ObjectLoader 99/1399/3
authorShawn O. Pearce <spearce@spearce.org>
Tue, 24 Aug 2010 19:46:56 +0000 (12:46 -0700)
committerChris Aniszczyk <caniszczyk@gmail.com>
Thu, 26 Aug 2010 00:03:47 +0000 (19:03 -0500)
commit2292655e9ecab7305c4f481f9c1a9463a383e834
tree147ff55dfb7f61c68c51a849f1936c69dbe24eae
parente69dcc703d9e11448108498d08888170b3861ea8
Add brute force byte array loading to ObjectLoader

Some algorithms are coded in a way that requires us to provide them
the entire object contents as a contiguous byte array.  The parsers
in RevCommit and RevTag, or our RawText objects are really good
examples of these.

Instead of duplicating this logic everywhere, lets put it into the
base ObjectLoader type.  That way the caller only needs to give us
their upper size bound, and we'll do the rest of the heavy work to
figure out if the object still fits within that bound, and get them
an array that has the complete contents.

Change-Id: Id95a7f79d2b97e39f6949370ccca2f2c9cfb1a0f
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectLoaderTest.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectLoader.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectStream.java