Code example for PipedOutputStream

Methods: write

0
 
	@Test 
	public void testTimeout_readBuffer_Success1() throws IOException { 
		final byte[] exp = new byte[] { 'a', 'b', 'c' };
		final byte[] act = new byte[exp.length];
		out.write(exp);
		IO.readFully(is, act, 0, act.length);
		assertArrayEquals(exp, act);
	} 
 
	@Test 
	public void testTimeout_readBuffer_Success2() throws IOException { 
		final byte[] exp = new byte[] { 'a', 'b', 'c' };
		final byte[] act = new byte[exp.length];
		out.write(exp);
		IO.readFully(is, act, 0, 1);
		IO.readFully(is, act, 1, 1);
		IO.readFully(is, act, 2, 1);
		assertArrayEquals(exp, act);
	}