Java BufferedReader Create getReader()

Here you can find the source of getReader()

Description

Method getReader returns the reader of this ConsoleUtils object.

License

Open Source License

Return

the reader (type BufferedReader) of this ConsoleUtils object.

Declaration

private static BufferedReader getReader() 

Method Source Code


//package com.java2s;
/*/*from w  ww  .  j  a va2s . c  om*/
 * Icegem, Extensions library for VMWare vFabric GemFire
 * 
 * Copyright (c) 2010-2011, Grid Dynamics Consulting Services Inc. or third-party  
 * contributors as indicated by the @author tags or express copyright attribution
 * statements applied by the authors.  
 * 
 * This copyrighted material is made available to anyone wishing to use, modify,
 * copy, or redistribute it subject to the terms and conditions of the GNU
 * Lesser General Public License v3, as published by the Free Software Foundation.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * 
 * You should have received a copy of the GNU Lesser General Public License v3
 * along with this distribution; if not, write to:
 * Free Software Foundation, Inc.
 * 51 Franklin Street, Fifth Floor
 * Boston, MA  02110-1301  USA
 */

import java.io.BufferedReader;

import java.io.InputStreamReader;

public class Main {
    /** Field bufferedReader  */
    private static BufferedReader bufferedReader;

    /**
     * Method getReader returns the reader of this ConsoleUtils object.
     *
     * @return the reader (type BufferedReader) of this ConsoleUtils object.
     */
    private static BufferedReader getReader() {
        if (bufferedReader == null) {
            bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        }

        return bufferedReader;
    }
}

Related

  1. getBufferedReaderAsResource(Class clazz, String fileName)
  2. getBufferedReaderFromFileName(File file)
  3. getBufferedReaderFromInputStream(InputStream src)
  4. getBufferedReaderFromInputStreamReader(InputStreamReader isReader)
  5. getBufferedReaderMaybeGZ(String f)
  6. getReader(File file)
  7. getReader(File file)
  8. getReader(File file)
  9. getReader(File file)