diff options
author | Narayan Kamath <narayan@google.com> | 2014-02-14 12:22:34 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-02-14 12:22:35 +0000 |
commit | 71eec8821710d08047ac1bff44fa5b5362ae39cb (patch) | |
tree | 241e32f0b2b1ab387917339f6ec6e324abed6f2c /luni | |
parent | d035213a8ddc7bff77a76a0bd6437305e2887f09 (diff) | |
parent | 7fbd82c654d1ad2348769b9340a1181abfa98fe9 (diff) | |
download | libcore-71eec8821710d08047ac1bff44fa5b5362ae39cb.zip libcore-71eec8821710d08047ac1bff44fa5b5362ae39cb.tar.gz libcore-71eec8821710d08047ac1bff44fa5b5362ae39cb.tar.bz2 |
Merge "Tidy up Console, fix ConsoleTest"
Diffstat (limited to 'luni')
-rw-r--r-- | luni/src/main/java/java/io/Console.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/luni/src/main/java/java/io/Console.java b/luni/src/main/java/java/io/Console.java index a1d2097..b6532eb 100644 --- a/luni/src/main/java/java/io/Console.java +++ b/luni/src/main/java/java/io/Console.java @@ -16,9 +16,7 @@ package java.io; import java.util.Formatter; -import libcore.io.ErrnoException; import libcore.io.Libcore; -import static libcore.io.OsConstants.*; /** * Provides access to the console, if available. The system-wide instance can @@ -48,12 +46,12 @@ public final class Console implements Flushable { } try { return new Console(System.in, System.out); - } catch (IOException ex) { + } catch (UnsupportedEncodingException ex) { throw new AssertionError(ex); } } - private Console(InputStream in, OutputStream out) throws IOException { + private Console(InputStream in, OutputStream out) throws UnsupportedEncodingException { this.reader = new ConsoleReader(in); this.writer = new ConsoleWriter(out); } @@ -181,7 +179,7 @@ public final class Console implements Flushable { } private static class ConsoleReader extends BufferedReader { - public ConsoleReader(InputStream in) throws IOException { + public ConsoleReader(InputStream in) throws UnsupportedEncodingException { super(new InputStreamReader(in, System.getProperty("file.encoding")), 256); lock = CONSOLE_LOCK; } |