]> source.dussan.org Git - jgit.git/commitdiff
LfsFactory#LfsInputStream: Override int read(byte[], int, int) 15/130215/1
authorDavid Pursehouse <david.pursehouse@gmail.com>
Mon, 1 Oct 2018 02:16:05 +0000 (11:16 +0900)
committerDavid Pursehouse <david.pursehouse@gmail.com>
Mon, 1 Oct 2018 02:16:05 +0000 (11:16 +0900)
According to Error Prone, the class should also override:

  int read(byte[], int, int)

otherwise multi-byte reads from this input stream are likely to be slow.

See https://errorprone.info/bugpattern/InputStreamSlowMultibyteRead

Change-Id: I33ab8cd30013447f2a0363b3a7b1424b79cb1818
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
org.eclipse.jgit/src/org/eclipse/jgit/util/LfsFactory.java

index 6d60ef3f4db6c645495af667654c2e488cc21d36..8c6cc52801b2fad7b7fce645b5dff59a99896c2c 100644 (file)
@@ -294,6 +294,11 @@ public class LfsFactory {
                        return stream.read();
                }
 
+               @Override
+               public int read(byte b[], int off, int len) throws IOException {
+                       return stream.read(b, off, len);
+               }
+
                /**
                 * @return the length of the stream
                 */