Here you can find the source of newReader(File file, String encoding)
private static BufferedReader newReader(File file, String encoding) throws IOException
//package com.java2s; /******************************************************************************* * Copyright (c) 2011 Sonatype, Inc./*from ww w . j a va 2 s . c o m*/ * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html *******************************************************************************/ import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; public class Main { private static BufferedReader newReader(File file, String encoding) throws IOException { if (encoding == null || encoding.length() <= 0) { return new BufferedReader(new InputStreamReader(new FileInputStream(file))); } return new BufferedReader(new InputStreamReader(new FileInputStream(file), encoding)); } }