IOUtil { public static String readString(InputStream inputStream, int bufSize) throws IOException { return new String(readBytes(inputStream, bufSize), CHARSET); }  static byte[] readBytes(InputStream inputStream, int bufSize); static String readString(InputStream inputStream, int bufSize); static void write(OutputStream outputStream, String message);  }
@Test public void testRead() throws FileNotFoundException, IOException { String content = IOUtil.readString(IOUtilTest.class.getResourceAsStream("io-test.txt"), 4096); Assert.assertEquals(content, REAL_CONTENT); }