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());
}