protected synchronized void setStream ( InputStream s ) { if ( stream != null ) { throw new UnsupportedOperationException ( "Cannot set the stream of an open resource" ) ; } stream = s ; streamState = StreamStates . OPEN ; }
Sets the stream for a resource . This function allows you to provide a stream that is already open to an existing resource . It will throw an exception if that resource already has an open stream .