From 6fadb8bdefec048898d151cd12fbf99e45457d28 Mon Sep 17 00:00:00 2001 From: Siben Nayak Date: Mon, 2 Apr 2018 16:34:35 +0530 Subject: [PATCH] Change StandardCharsets to Charsets --- .../src/main/kotlin/com/baeldung/filesystem/FileReader.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/core-kotlin/src/main/kotlin/com/baeldung/filesystem/FileReader.kt b/core-kotlin/src/main/kotlin/com/baeldung/filesystem/FileReader.kt index 6897a87cb2..05a2ac03bb 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/filesystem/FileReader.kt +++ b/core-kotlin/src/main/kotlin/com/baeldung/filesystem/FileReader.kt @@ -3,7 +3,6 @@ package com.baeldung.filesystem import java.io.BufferedReader import java.io.File import java.io.InputStream -import java.nio.charset.StandardCharsets class FileReader { @@ -25,16 +24,16 @@ class FileReader { } fun readFileAsLinesUsingReadLines(fileName: String): List { - return File(fileName).readLines(StandardCharsets.UTF_8) + return File(fileName).readLines() } fun readFileAsTextUsingInputStream(fileName: String): String { val inputStream: InputStream = File(fileName).inputStream() - return inputStream.readBytes().toString(StandardCharsets.UTF_8) + return inputStream.readBytes().toString(Charsets.UTF_8) } fun readFileDirectlyAsText(fileName: String): String { - return File(fileName).readText(StandardCharsets.UTF_8) + return File(fileName).readText(Charsets.UTF_8) } } \ No newline at end of file