@Override
    @FFDCIgnore(InterruptedException.class)
    public void close() throws IOException {
        synchronized(this) {
            if(closed){
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Input stream close previously called ...return ");
                }
                return;
            }
            else{
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Calling close on the util class");
                }
                closed = true;
                //Call close on the helper buffer class
                if(_inBuffer.close()){
                    try {
                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                            Tr.debug(tc, "Timeout has been called, waiting for it to complete, " + _inBuffer.isClosing());
                        }
                        this.wait();
                    } catch (InterruptedException e) {
                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                            Tr.debug(tc, "Completed waiting for timeout to be called");
                        }
                    }
                }
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Calling close on parent");
                }
                //Call the super close
                super.close();
            }
        }
    }
@ Override @ FFDCIgnore ( InterruptedException . class ) public void close ( ) throws IOException { synchronized ( this ) { if ( closed ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Input stream close previously called ...return " ) ; } return ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Calling close on the util class" ) ; } closed = true ; if ( _inBuffer . close ( ) ) { try { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Timeout has been called, waiting for it to complete, " + _inBuffer . isClosing ( ) ) ; } this . wait ( ) ; } catch ( InterruptedException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Completed waiting for timeout to be called" ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Calling close on parent" ) ; } super . close ( ) ; } } }
/* (non-Javadoc)
@see java.io.InputStream#close()