Here you can find the source of getBufferedReader(Reader r)
Parameter | Description |
---|---|
r | The reader being wrapped. |
public static Reader getBufferedReader(Reader r)
//package com.java2s; // * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * import java.io.*; public class Main { /**/*from w w w .ja v a2 s.c o m*/ * Wraps the specified reader in a buffered reader. * * @param r The reader being wrapped. * @return The reader wrapped in a {@link BufferedReader}, or the original {@link Reader} if it's already * a buffered reader. */ public static Reader getBufferedReader(Reader r) { if (r instanceof BufferedReader || r instanceof StringReader) return r; return new BufferedReader(r); } }