Ensure RawText closes the FileInputStream when read is complete
commitc581672557f0fb014babeb79c15d7f79fb206908
authorShawn O. Pearce <spearce@spearce.org>
Wed, 3 Feb 2010 16:23:34 +0000 (3 08:23 -0800)
committerShawn O. Pearce <spearce@spearce.org>
Wed, 3 Feb 2010 16:23:34 +0000 (3 08:23 -0800)
tree8e41a21b0839ead5f10015c663cdf495dcac3186
parent0e137c4d9e5c245424e78208a104fbc8b3aaee2a
Ensure RawText closes the FileInputStream when read is complete

Rather than implementing the file reading logic ourselves, and
wind up leaking the FileInputStream's file descriptor until the
next GC, use IO.readFully(File) which wraps the read loop inside
of a try/finally to ensure the stream is closed before it exits.

Change-Id: I85a3fe87d5eff88fa788962004aebe19d2e91bb4
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Reviewed-by: Roland Grunberg <rgrunber@redhat.com>
org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java