Package com.jitlogic.zorka.common.util

Examples of com.jitlogic.zorka.common.util.TapOutputStream



    @Test
    public void testTapOutpuStreamWriteChars() throws Exception {
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        TapOutputStream tos = new TapOutputStream(os);

        tos.write(65); tos.write(66);

        assertEquals("AB", tos.asString());
        assertEquals("AB", new String(os.toByteArray()));
    }
View Full Code Here



    @Test
    public void testTapOutputStreamWriteArray() throws Exception {
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        TapOutputStream tos = new TapOutputStream(os);

        tos.write("ABC".getBytes());

        assertEquals("ABC", tos.asString());
        assertEquals("ABC", new String(os.toByteArray()));
    }
View Full Code Here


    @Test
    public void testTapOutputStreamWriteArrayWithOffset() throws Exception {
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        TapOutputStream tos = new TapOutputStream(os);

        tos.write("ABCD".getBytes(), 1, 2);

        assertEquals("BC", tos.asString());
        assertEquals("BC", new String(os.toByteArray()));
    }
View Full Code Here

    public TapInputStream tapInputStream(InputStream is, long init, long limit) {
        return new TapInputStream(is, (int)init, (int)limit);
    }

    public TapOutputStream tapOutputStream(OutputStream os, long init, long limit) {
        return new TapOutputStream(os, (int)init, (int)limit);
    }
View Full Code Here

TOP

Related Classes of com.jitlogic.zorka.common.util.TapOutputStream

Copyright © 2018 www.massapicom. 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.