Code example for PipedOutputStream

Methods: write

	 * @tests 
	public void test_close() throws IOException { 
		// Test for method void 
		pis = new PipedInputStream();
		pos = new PipedOutputStream();
		try { 
			pos.write((byte) 127);
            fail("Failed to throw expected exception");
		} catch (IOException e) {
			// The spec for PipedInput saya an exception should be thrown if 
			// a write is attempted to a closed input. The PipedOuput spec 
			// indicates that an exception should be thrown only when the 
			// piped input thread is terminated without closing 
Connect your IDE to all the code out there  Get Codota for Java