Here you can find the source of newReader(ReadableByteChannel ch, Charset cs)
public static BufferedReader newReader(ReadableByteChannel ch, Charset cs)
//package com.java2s; import java.io.BufferedReader; import java.nio.channels.Channels; import java.nio.channels.ReadableByteChannel; import java.nio.charset.Charset; public class Main { public static BufferedReader newReader(ReadableByteChannel ch, Charset cs) { if (ch == null) return null; return new BufferedReader(Channels.newReader(ch, cs.newDecoder(), -1)); }//from ww w .j av a 2 s . c om }