/** * Test method for {@link com.googlecode.socofo.common.impl.IOHelperImpl#read(java.io.InputStream, * byte[])} . */ @Test public final void testRead() { final byte[] buffer = new byte[5000]; final BufferedInputStream bis = new BufferedInputStream(getClass().getResourceAsStream("/buffertest.txt")); final int read = to.read(bis, buffer); Assert.assertTrue(read > 0); to.closeInputstream(bis); String str = to.createString(buffer, "utf-8"); Assert.assertNotNull(str); str = str.trim(); Assert.assertEquals("test", str); }
/** * Test method for {@link * com.googlecode.socofo.common.impl.IOHelperImpl#closeInputstream(java.io.InputStream)} . */ @Test public final void testCloseInputstream() { to.closeInputstream(null); }