public void interceptStream ( int index , OutputStream stream ) throws GuacamoleException { // Log beginning of intercepted stream logger . debug ( "Intercepting output stream #{} of tunnel \"{}\"." , index , getUUID ( ) ) ; try { outputStreamFilter . interceptStream ( index , new BufferedOutputStream ( stream ) ) ; } // Log end of intercepted stream finally { logger . debug ( "Intercepted output stream #{} of tunnel \"{}\" ended." , index , getUUID ( ) ) ; } }
Intercept all data received along the stream having the given index writing that data to the given OutputStream . The OutputStream will automatically be closed when the stream ends . If there is no such stream then the OutputStream will be closed immediately . This function will block until all received data has been written to the OutputStream and the OutputStream has been closed .