Code example for PipedInputStream

Methods: close, read

0
	public void run() { 
		byte[] b = new byte[1024];
		int length = 0;
		 
		try { 
			length = pipIn.read(b);
		} catch (IOException e) {
			e.printStackTrace();
		} 
		 
		try { 
			pipIn.close();
		} catch (IOException e) {
			e.printStackTrace();
		} 
		 
		System.out.println("接收内容为:" + new String(b, 0, length));
	} 
 
	public final PipedInputStream getPipIn() {
		return pipIn;