package io.github.lionell;

import ua.yandex.shad.stream.AsIntStream;
import ua.yandex.shad.stream.IntStream;

import java.util.Scanner;

/**
 * Created by lionell on 11/29/15.
 *
 * @author Ruslan Sakevych
 */
public class App {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println("Hello from App!");
        System.out.print("Enter elements count > ");
        int n = in.nextInt();
        System.out.print("Enter elements > ");
        int[] ints = new int[n];
        for (int i = 0; i < n; i++) {
            ints[i] = in.nextInt();
        }
        in.close();
        IntStream intStream = AsIntStream.of(ints);
        int res = intStream
                .filter(x -> x > 0)
                .map(x -> x * x)
                .flatMap(x -> AsIntStream.of(x - 1, x, x + 1))
                .reduce(0, (sum, x) -> sum += x);
        System.out.println("Result: " + res);
    }
}

@@ -120,18 +120,249 @@
 ava.
-util.Scann
+io.BufferedOutputStream;%0Aimport java.io.BufferedReader;%0Aimport java.io.FileNotFoundException;%0Aimport java.io.FileReader;%0Aimport java.io.IOException;%0Aimport java.io.InputStreamReader;%0Aimport java.io.PrintWriter;%0Aimport java.util.StringTokeniz
 er;%0A
@@ -511,40 +511,108 @@
     
-Scanner in = new Scanner
+Reader in = new Reader();%0A        PrintWriter out = new PrintWriter(new BufferedOutputStream
 (System.
 in);
@@ -607,18 +607,20 @@
 (System.
-in
+out)
 );%0A     
@@ -614,39 +614,32 @@
 .out));%0A        
-System.
 out.println(%22Hel
@@ -654,39 +654,32 @@
 App!%22);%0A        
-System.
 out.print(%22Enter
@@ -730,39 +730,32 @@
 tInt();%0A        
-System.
 out.print(%22Enter
@@ -891,28 +891,8 @@
   %7D%0A
-        in.close();%0A
     
@@ -1157,23 +1157,16 @@
         
-System.
 out.prin
@@ -1184,20 +1184,1164 @@
 : %22 + res);%0A
+        in.close();%0A        out.close();%0A    %7D%0A%0A    private static class Reader %7B%0A        private BufferedReader reader;%0A        private StringTokenizer tokenizer;%0A%0A        public Reader() %7B%0A            reader = new BufferedReader(new InputStreamReader(System.in));%0A        %7D%0A%0A        public Reader(String s) %7B%0A            try %7B%0A                reader = new BufferedReader(new FileReader(s));%0A            %7D catch (FileNotFoundException e) %7B%0A                e.printStackTrace();%0A            %7D%0A        %7D%0A%0A        public String nextToken() %7B%0A            while (tokenizer == null %7C%7C !tokenizer.hasMoreElements()) %7B%0A                try %7B%0A                    tokenizer = new StringTokenizer(reader.readLine());%0A                %7D catch (IOException e) %7B%0A                    e.printStackTrace();%0A                %7D%0A            %7D%0A            return tokenizer.nextToken();%0A        %7D%0A%0A        public int nextInt() %7B%0A            return Integer.parseInt(nextToken());%0A        %7D%0A%0A        public void close() %7B%0A            try %7B%0A                reader.close();%0A            %7D catch (IOException e) %7B%0A                e.printStackTrace();%0A            %7D%0A        %7D%0A
     %7D%0A%7D%0A

Add nested Reader class to App.