Exemplo n.º 1
0
 public static List <string> ReadLines(string filePath, Encoding defaultEncoding)
 {
     using (var stream = FileStreamEx.OpenReadFileStream(filePath))
         using (var reader = new StaticEncodingLineReader(stream, defaultEncoding))
         {
             return(reader.ReadLines().ToList());
         }
 }
Exemplo n.º 2
0
        public static List <string> ReadLines(string filePath, Encoding encoding)
        {
            if (filePath == null)
            {
                throw new ArgumentNullException(nameof(filePath));
            }

            using (var stream = FileStreamEx.OpenReadFileStream(filePath))
                using (var reader = new StaticEncodingLineReader(stream, encoding))
                {
                    return(reader.ReadLines().ToList());
                }
        }