Refactor TransportBundle to not be dependent on FileInputStream
commitf444aa26b5ab4a0b910041bdb81de97b9320ae96
authorShawn O. Pearce <spearce@spearce.org>
Thu, 4 Sep 2008 23:42:18 +0000 (4 16:42 -0700)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Sun, 7 Sep 2008 21:24:09 +0000 (7 23:24 +0200)
tree9b302c6d4b27085a53e1cfb66a947fb1ca872233
parente8d37e1fb52322945ef14f519870999f95686825
Refactor TransportBundle to not be dependent on FileInputStream

By using a straight up BufferedInputStream and making it play nicely
with IndexPack's internal buffering we can permit TransportBundle to
accept input from any sort of InputStream, not just those that have
a positionable Channel underneath of them.  This makes it possible
to stream a bundle over the network, or from a byte[] in memory.

IndexPack now publishes its BUFFER_SIZE member so callers can create
their own BufferedInputStream with the same size buffer.  This way we
can be sure that reads after the first bypass BufferedInputStream's
buffer and go directly into IndexPack's buffer.

The BUFFER_SIZE is increased to 8192 as that is the same size that
is used by default in BufferedInputStream in Java 6.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
org.spearce.jgit/src/org/spearce/jgit/transport/BasePackConnection.java
org.spearce.jgit/src/org/spearce/jgit/transport/IndexPack.java
org.spearce.jgit/src/org/spearce/jgit/transport/TransportBundle.java