Here you can find the source of getBufferedReader(InputStream stream, String charset)
private static BufferedReader getBufferedReader(InputStream stream, String charset) throws UnsupportedEncodingException
//package com.java2s; /**/* w ww .j av a 2 s .co m*/ * Aptana Studio * Copyright (c) 2005-2011 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the GNU Public License (GPL) v3 (with exceptions). * Please see the license.html included with this distribution for details. * Any modifications to this file must keep this entire header intact. */ import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; public class Main { /** * Default buffer size. */ private static final int DEFAULT_SIZE = 15 * 1024; private static BufferedReader getBufferedReader(InputStream stream, String charset) throws UnsupportedEncodingException { InputStreamReader inputReader; if (charset == null) { inputReader = new InputStreamReader(stream); } else { inputReader = new InputStreamReader(stream, charset); } return new BufferedReader(inputReader, DEFAULT_SIZE); } }