Code example for PipedOutputStream

0
	PipedInputStream forSphinx; 
	InputStream result; 
	 
	public ProcessingAdapter() throws IOException{ 
		forSphinx = new PipedInputStream(); 
		toProcessor = new PipedOutputStream(forSphinx); 
		result = null; 
	} 
	 
	public OutputStream getStreamToProcessor(){ 
		return toProcessor; 
	} 
	 
	public InputStream getDetectedWordsStream() throws IOException{ 
		if(result == null){ 
			AudioFormat pcmFormat = new AudioFormat(9615f, 8, 2, 
					true, false); 
			AudioInputStream ais = new AudioInputStream(StreamConverter.unsignedToSigned(forSphinx), 
					pcmFormat, Long.MAX_VALUE); 
			result = StreamTranscriber.transcribeStream(ais); 
		}