Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task03 Chelpanov Pri_201 #272

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 8 additions & 6 deletions task03/src/com/example/task03/Task03Main.java
@@ -1,21 +1,23 @@
package com.example.task03;

import java.io.IOException;
import java.io.InputStream;
import java.io.*;
import java.nio.charset.Charset;

public class Task03Main {
public static void main(String[] args) throws IOException {
//здесь вы можете вручную протестировать ваше решение, вызывая реализуемый метод и смотря результат
// например вот так:

/*

System.out.println(readAsString(new FileInputStream("task03/src/com/example/task03/input.test"), Charset.forName("KOI8-R")));
*/

}

public static String readAsString(InputStream inputStream, Charset charset) throws IOException {
// your implementation here
return "";
if (inputStream == null || charset == null)
throw new IllegalArgumentException();

BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, charset));
return reader.readLine();
}
}