Package org.apache.abdera.i18n.text.io

Examples of org.apache.abdera.i18n.text.io.PipeChannel


            assertEquals(buf2[n], buf1[n]);
    }

    @Test
    public void testPipeChannel() throws Exception {
        PipeChannel pc = new PipeChannel();
        assertTrue(pc.isWritable());
        assertFalse(pc.isReadable());
        OutputStream out = pc.getOutputStream();
        out.write(0x01);
        out.write(0x02);
        out.write(0x03);
        out.write(0x04);
        out.close();
        assertFalse(pc.isWritable());
        assertTrue(pc.isReadable());
        InputStream in = pc.getInputStream();
        byte[] buf = new byte[4];
        in.read(buf);
        assertEquals(0x1, buf[0]);
        assertEquals(0x2, buf[1]);
        assertEquals(0x3, buf[2]);
        assertEquals(0x4, buf[3]);
        in.close();
        assertTrue(pc.isWritable());
        assertFalse(pc.isReadable());
    }
View Full Code Here


      assertEquals(buf1[n],buf2[n]);
  }
 
  @Test
  public void testPipeChannel() throws Exception {
    PipeChannel pc = new PipeChannel();
    assertTrue(pc.isWritable());
    assertFalse(pc.isReadable());
    OutputStream out = pc.getOutputStream();
    out.write(0x01);
    out.write(0x02);
    out.write(0x03);
    out.write(0x04);
    out.close();
    assertFalse(pc.isWritable());
    assertTrue(pc.isReadable());   
    InputStream in = pc.getInputStream();
    byte[] buf = new byte[4];
    in.read(buf);
    assertEquals(buf[0],0x1);
    assertEquals(buf[1],0x2);
    assertEquals(buf[2],0x3);
    assertEquals(buf[3],0x4);
    in.close();
    assertTrue(pc.isWritable());
    assertFalse(pc.isReadable());
  }
View Full Code Here

TOP

Related Classes of org.apache.abdera.i18n.text.io.PipeChannel

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.