+
+ static void checkNext(TestCase test, boolean callNext, String prefix,
+ NextableInputStream in, byte[] expected) throws Exception {
+ if (callNext) {
+ test.assertEquals("Cannot get " + prefix + " entry", true,
+ in.next());
+ }
+ byte[] actual = IOUtils.toByteArray(in);
+ test.assertEquals("The " + prefix
+ + " resulting array has not the correct number of items",
+ expected.length, actual.length);
+ for (int i = 0; i < actual.length; i++) {
+ test.assertEquals("Item " + i + " (0-based) is not the same",
+ expected[i], actual[i]);
+ }
+ }