Method ignores results of InputStream.skip()
commit4af41e304039dd8f25ad55d4d4ae3051575ced66
authorMatthias Sohn <matthias.sohn@sap.com>
Tue, 28 Apr 2009 22:26:15 +0000 (29 00:26 +0200)
committerShawn O. Pearce <spearce@spearce.org>
Tue, 28 Apr 2009 22:54:44 +0000 (28 15:54 -0700)
tree7158dd838041b196352f99abca540319bea0dd36
parent6c0376b72b5e0ec5a0c941f1b069b6744808f27f
Method ignores results of InputStream.skip()

This method ignores the return value of java.io.InputStream.skip()
which can skip multiple bytes.  If the return value is not checked,
the caller will not be able to correctly handle the case where
fewer bytes were skipped than the caller requested. This is
a particularly insidious kind of bug, because in many programs,
skips from input streams usually do skip the full amount of data
requested, causing the program to fail only sporadically. With
buffered streams, however, skip() will only skip data in the buffer,
and will routinely fail to skip the requested number of bytes.

Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.spearce.jgit/src/org/spearce/jgit/transport/BundleFetchConnection.java