@@ -0,0 +1,1837 @@
+package com.hypirion.io;%0A%0Aimport java.io.InputStream;%0Aimport java.io.OutputStream;%0Aimport java.io.InputStreamReader;%0Aimport java.io.Console;%0A%0Aimport java.lang.reflect.Method;%0Aimport java.lang.reflect.Field;%0A%0Apublic class ConsoleUtils %7B%0A%0A    public static boolean setEcho(boolean on) throws Exception %7B%0A        Class params%5B%5D = new Class%5B1%5D;%0A        params%5B0%5D = Boolean.TYPE;%0A        Method echo = Console.class.getDeclaredMethod(%22echo%22, params);%0A        echo.setAccessible(true);%0A        boolean res = (Boolean) echo.invoke(null, on);%0A        Field echoOff = Console.class.getDeclaredField(%22echoOff%22);%0A        echoOff.setAccessible(true);%0A        echoOff.set(null, res);%0A        return res;%0A    %7D%0A    %0A    public static char%5B%5D readPassword(InputStream is) throws Exception %7B%0A        try %7B%0A            synchronized(is) %7B%0A                setEcho(false);%0A                InputStreamReader isr = new InputStreamReader(is);%0A                char%5B%5D buf = new char%5B32%5D;%0A                int len = 0;%0A                loop:%0A                while (true) %7B%0A                    int c = isr.read();%0A                    switch (c) %7B%0A                    case -1:%0A                    case '%5Cn':%0A                        break loop;%0A                    case '%5Cr':%0A                        continue;%0A                    %7D%0A                    buf%5Blen%5D = (char) c;%0A                    len++;%0A                    if (len == buf.length) %7B%0A                        char%5B%5D fresh = new char%5B2*len%5D;%0A                        System.arraycopy(buf, 0, fresh, 0, len);%0A                        buf = fresh;%0A                    %7D%0A                %7D%0A                char%5B%5D out = new char%5Blen%5D;%0A                System.arraycopy(buf, 0, out, 0, len);%0A                return out;%0A            %7D%0A        %7D%0A        finally %7B%0A            setEcho(true);            %0A        %7D%0A    %7D%0A%7D%0A

Implement setEcho and readPassword.