Override int read(byte[], int, int) on test instances of InputStream

This probably doesn't provide any benefit for the tests, but gets
rid of a warning from Error Prone.

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

Change-Id: I584d2e0d18475fad38747b688af6301c423f54a7
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
This commit is contained in:
David Pursehouse 2018-10-01 11:18:45 +09:00
parent 731d638f69
commit 65d6bb073a
2 changed files with 11 additions and 0 deletions

View File

@ -260,6 +260,12 @@ public int read() throws IOException {
fail("never should have reached read");
return -1;
}
@Override
public int read(byte b[], int off, int len) {
fail("never should have reached read");
return -1;
}
};
}
};

View File

@ -259,6 +259,11 @@ public void testNonBlockingPartialRead() throws Exception {
public int read() throws IOException {
throw new IOException("Expected");
}
@Override
public int read(byte b[], int off, int len) throws IOException {
throw new IOException("Expected");
}
};
@SuppressWarnings("resource" /* java 7 */)
final UnionInputStream u = new UnionInputStream(