Java UTF8 File Read readLines(File inputFile)

Here you can find the source of readLines(File inputFile)

Description

read lines from the given inputFile

License

Apache License

Parameter

Parameter Description
inputFile a parameter

Exception

Parameter Description
Exception an exception

Return

a list of Strings

Declaration

public static List<String> readLines(File inputFile) throws Exception 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.File;

import java.nio.charset.Charset;
import java.nio.file.Files;

import java.util.List;

public class Main {
    /**/*w ww .j ava2s  .co m*/
     * read lines from the given inputFile
     * @param inputFile
     * @return a list of Strings
     * @throws Exception
     */
    public static List<String> readLines(File inputFile) throws Exception {
        List<String> list = Files.readAllLines(inputFile.toPath(), Charset.defaultCharset());
        return list;
    }
}

Related

  1. makeUTF8Reader(InputStream inputStream)
  2. newUtf8Reader(final InputStream in)
  3. openFileReaderUTF8(File file)
  4. readAllLines(File inputFile)
  5. readAsUTF8(String text)
  6. readRawUTF8Bytes(final byte[] bytes)
  7. readResourceUtf8(Class contextClass, String filename)
  8. readStringFromUTF8Stream(InputStream is)
  9. readStringUTF16LE(byte[] var0, int var1, int var2)