Package com.jitlogic.zorka.common.util

Examples of com.jitlogic.zorka.common.util.TapInputStream.asString()


        TapInputStream tis = new TapInputStream(new ByteArrayInputStream("ABCD".getBytes()));

        assertEquals(65, tis.read());
        assertEquals(66, tis.read());

        assertEquals("AB", tis.asString());
    }


    @Test
    public void testTapInputStreamReadArray() throws Exception {
View Full Code Here


    public void testTapInputStreamReadArray() throws Exception {
        TapInputStream tis = new TapInputStream(new ByteArrayInputStream("ABCD".getBytes()));

        assertEquals(4, tis.read(new byte[4]));

        assertEquals("ABCD", tis.asString("UTF-8"));
    }


    @Test
    public void testTapInputStreamReadArrayWithOffset() throws Exception {
View Full Code Here

    public void testTapInputStreamReadArrayWithOffset() throws Exception {
        TapInputStream tis = new TapInputStream(new ByteArrayInputStream("ABCD".getBytes()));

        assertEquals(2, tis.read(new byte[4], 2, 2));

        assertEquals("AB", tis.asString());
    }


    @Test
    public void testTapInputStreamWithMarkAndReset() throws Exception {
View Full Code Here

        tis.read(new byte[2]); tis.mark(100);
        tis.read(new byte[2]); tis.reset();
        tis.read(new byte[3]);

        assertEquals("ABCDE", tis.asString());
    }


    @Test
    public void testTapOutpuStreamWriteChars() throws Exception {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.