Java UTF8 File Read makeUTF8Reader(InputStream inputStream)

Here you can find the source of makeUTF8Reader(InputStream inputStream)

Description

Constructs a new Reader based on the UTF-8 encoding.

License

Open Source License

Parameter

Parameter Description
inputStream the underlying input stream.

Return

a corresponding Reader.

Declaration

public static Reader makeUTF8Reader(InputStream inputStream) 

Method Source Code


//package com.java2s;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;

import java.nio.charset.Charset;

public class Main {
    /** The UTF-8 Charset. */
    public static final Charset UTF_8_CHARSET = Charset.forName("UTF-8");

    /**//from   w  w w  . j av  a 2 s . c om
     * Constructs a new Reader based on the UTF-8 encoding.
     * @param inputStream the underlying input stream.
     * @return a corresponding Reader.
     */
    public static Reader makeUTF8Reader(InputStream inputStream) {
        return new InputStreamReader(inputStream, UTF_8_CHARSET);
    }
}

Related

  1. getUtf8BytesFromFile(String fileName)
  2. getUtf8FileWriter(String file, boolean append)
  3. getUTF8InputStreamReader(InputStream stream)
  4. getUTF8Reader(File f)
  5. loadUTF8(File file)
  6. newUtf8Reader(final InputStream in)
  7. openFileReaderUTF8(File file)
  8. readAllLines(File inputFile)
  9. readAsUTF8(String text)