Package org.jnode.shell.io

Examples of org.jnode.shell.io.Pipeline.activate()


    public void testTwo10_One10() throws Throwable {
        Pipeline p = new Pipeline();
        InputStream is = p.createSink();
        OutputStream os = p.createSource();
        OutputStream os2 = p.createSource();
        p.activate();

        Source source = new Source("1111111111".getBytes(), 1000, -1, os);
        Source source2 = new Source("2222222222".getBytes(), 1000, -1, os2);
        Sink sink = new Sink(20000, 10, -1, is);
View Full Code Here


    public void testTwo100_One100() throws Throwable {
        Pipeline p = new Pipeline();
        InputStream is = p.createSink();
        OutputStream os = p.createSource();
        OutputStream os2 = p.createSource();
        p.activate();

        byte[] buff1 = new byte[100];
        Arrays.fill(buff1, (byte) '1');
        Source source = new Source(buff1, 100, -1, os);
        byte[] buff2 = new byte[100];
View Full Code Here

    public void testTwo100_One100_SmallBuffer() throws Throwable {
        Pipeline p = new Pipeline(100);
        InputStream is = p.createSink();
        OutputStream os = p.createSource();
        OutputStream os2 = p.createSource();
        p.activate();

        byte[] buff1 = new byte[100];
        Arrays.fill(buff1, (byte) '1');
        Source source = new Source(buff1, 100, -1, os);
        byte[] buff2 = new byte[100];
View Full Code Here

        InputStream is = p.createSink();
        OutputStream os = p.createSource();
        Assert.assertFalse(p.isActive());
        Assert.assertFalse(p.isClosed());
        Assert.assertFalse(p.isShutdown());
        p.activate();
        Assert.assertTrue(p.isActive());
        Assert.assertFalse(p.isClosed());
        Assert.assertFalse(p.isShutdown());
        is.close();
        os.close();
View Full Code Here

        Pipeline p = new Pipeline();
        InputStream is = p.createSink();
        OutputStream os = p.createSource();
        Assert.assertFalse(p.isActive());
        Assert.assertFalse(p.isShutdown());
        p.activate();
        Assert.assertTrue(p.isActive());
        Assert.assertFalse(p.isShutdown());
        p.shutdown();
        Assert.assertFalse(p.isActive());
        Assert.assertTrue(p.isShutdown());
View Full Code Here

        // the same thread ... because we are reading/writing less than a buffer
        // full.
        Pipeline p = new Pipeline();
        InputStream is = p.createSink();
        OutputStream os = p.createSource();
        p.activate();
        Assert.assertEquals(0, is.available());
        os.write('A');
        Assert.assertEquals(1, is.available());
        Assert.assertEquals('A', is.read());
        os.write('B');
View Full Code Here

    public void testTwo1_One1() throws Throwable {
        Pipeline p = new Pipeline();
        InputStream is = p.createSink();
        OutputStream os = p.createSource();
        OutputStream os2 = p.createSource();
        p.activate();

        Source source = new Source("1".getBytes(), 10000, -1, os);
        Source source2 = new Source("2".getBytes(), 10000, -1, os2);
        Sink sink = new Sink(20000, 1, -1, is);
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.