@Test public void testReadAllBytes() { URL url = getClass().getResource("TestFile.txt"); String filePath = url.getPath().toString(); File file = new File(filePath); InputStream is = null; try { is = new FileInputStream(file); } catch (FileNotFoundException e) { fail("Failed to retrieve test file: " + file.getAbsolutePath()); } byte[] bytes = IOUtil.readAllBytes(is, 1024); assertNotNull(bytes); assertEquals(10, bytes.length); byte[] inputArray_1 = {(byte) 0x03, (byte) 0x00, (byte) 0x00, (byte) 0x00}; int expected = inputArray_1.length; InputStream byteStream = new ByteArrayInputStream(inputArray_1); byte[] actual = IOUtil.readAllBytes(byteStream); assertNotNull(actual); assertEquals(expected, actual.length); }
public static byte[] readAllBytes(InputStream is) { return readAllBytes(is, 2048); }
IOUtil { public static byte[] readAllBytes(InputStream is) { return readAllBytes(is, 2048); } }
IOUtil { public static byte[] readAllBytes(InputStream is) { return readAllBytes(is, 2048); }  }
IOUtil { public static byte[] readAllBytes(InputStream is) { return readAllBytes(is, 2048); }  static void close(Closeable... closeables); static void pipe(InputStream is, OutputStream out, int bufsize); static byte[] readAllBytes(InputStream is); static byte[] readAllBytes(InputStream is, int bufsize); }
IOUtil { public static byte[] readAllBytes(InputStream is) { return readAllBytes(is, 2048); }  static void close(Closeable... closeables); static void pipe(InputStream is, OutputStream out, int bufsize); static byte[] readAllBytes(InputStream is); static byte[] readAllBytes(InputStream is, int bufsize);  }