Code example for Reader

Methods: close, read

0
        int ch = -1;
 
        // The readers return -1 if they end. So simply read the "prepend" 
        // after that the "content" and at the end the "append" file. 
        if (prependReader != null) {
            ch = prependReader.read();
            if (ch == -1) {
                // I am the only one so I have to close the reader 
                prependReader.close();
                prependReader = null;
            } 
        } 
        if (ch == -1) {
            ch = super.read();
        } 
        if (ch == -1) {
            // don't call super.close() because that reader is used 
            // on other places ... 
            if (appendReader != null) {
                ch = appendReader.read();
                if (ch == -1) {