Java Text File Read by Charset newReader(ReadableByteChannel ch, Charset cs)

Here you can find the source of newReader(ReadableByteChannel ch, Charset cs)

Description

new Reader

License

Open Source License

Declaration

public static BufferedReader newReader(ReadableByteChannel ch, Charset cs) 

Method Source Code


//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
}

Related

  1. inputStreamToString(InputStream input, Charset charset, boolean closeInputAfterRead)
  2. newBufferedFileReader(File file, Charset charset)
  3. newBufferedReader(URL url, Charset cs)
  4. newReader(File file, Charset charset)
  5. newReader(InputStream input, Charset encoding)
  6. newUTF8CharSetReader(String filename)
  7. openNewCompressedInputReader(final InputStream inputStream, final Charset charset)
  8. read(File file, Charset charset)
  9. read(InputStream _is, CharsetDecoder _decoder)