Code example for ByteArrayOutputStream

Methods: closereset

0
        stream = new PrintStream(baos);
        logger = new StandardErrorLogger("test", stream);
    } 
 
    public void tearDown() throws IOException { 
        baos.reset();
        baos.close();
    } 
 
    public void testWithDebuggingDisabled() { 
        logger.setDebugEnable(false);
        logger.debug("test");
        stream.flush();
        Assert.assertEquals("", baos.toString());
    } 
 
    public void testWithException() { 
        logger.setDebugEnable(true);
        logger.debug(new IllegalStateException());
        stream.flush();
Connect your IDE to all the code out there  Get Codota for Java