now mostly streamified!
[nikiroo-utils.git] / src / be / nikiroo / utils / test_code / NextableInputStreamTest.java
index f8031f0d3b040035d77087b51e3534052fd801ae..cfb205b2145e1216f9139c488882cd0104b60ea0 100644 (file)
@@ -19,16 +19,7 @@ public class NextableInputStreamTest extends TestLauncher {
                                byte[] expected = new byte[] { 42, 12, 0, 127 };
                                NextableInputStream in = new NextableInputStream(
                                                new ByteArrayInputStream(expected), null);
-                               in.next();
-                               byte[] actual = IOUtils.toByteArray(in);
-
-                               assertEquals(
-                                               "The resulting array has not the same number of items",
-                                               expected.length, actual.length);
-                               for (int i = 0; i < expected.length; i++) {
-                                       assertEquals("Item " + i + " (0-based) is not the same",
-                                                       expected[i], actual[i]);
-                               }
+                               checkNext(this, "READ", in, expected);
                        }
                });