Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.javarush.task.task18.task1810;
- /*
- DownloadException
- */
- import java.io.BufferedReader;
- import java.io.FileInputStream;
- import java.io.IOException;
- import java.io.InputStreamReader;
- public class Solution {
- public static void main(String[] args) throws DownloadException, IOException {
- BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
- String nameFile = reader.readLine();
- FileInputStream fileInputStream = new FileInputStream(nameFile);
- while (fileInputStream.available() > 1000){
- if (fileInputStream.available() < 1000){
- fileInputStream.close();
- throw new DownloadException();
- }
- nameFile = reader.readLine();
- fileInputStream = new FileInputStream(nameFile);
- }
- }
- public static class DownloadException extends Exception {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement