Here you can find the source of toBufferedReader(Reader reader)
Parameter | Description |
---|---|
reader | the reader to wrap or return |
public static BufferedReader toBufferedReader(Reader reader)
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { /**//from w w w . ja v a 2 s . c o m * Returns the given reader if it is a {@link BufferedReader}, otherwise creates a toBufferedReader for the given * reader. * * @param reader * the reader to wrap or return * @return the given reader or a new {@link BufferedReader} for the given reader * @since 2.2 */ public static BufferedReader toBufferedReader(Reader reader) { return reader instanceof BufferedReader ? (BufferedReader) reader : new BufferedReader(reader); } }