summaryrefslogtreecommitdiffstats
path: root/luni
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2011-05-25 10:51:51 -0700
committerElliott Hughes <enh@google.com>2011-05-25 10:51:51 -0700
commitdd3297417120e11cfafd502f008b4719f6974bd8 (patch)
tree640edb6e28489ddc837de19aa7c8d85cd0f730c9 /luni
parent23c3b7f76a8ec59d5329417d53d83b14242441de (diff)
downloadlibcore-dd3297417120e11cfafd502f008b4719f6974bd8.zip
libcore-dd3297417120e11cfafd502f008b4719f6974bd8.tar.gz
libcore-dd3297417120e11cfafd502f008b4719f6974bd8.tar.bz2
Make it possible to test java.io.Console.
Change-Id: I9389c6625ba0837dbe1cc62c785fc2091ecbf24e
Diffstat (limited to 'luni')
-rw-r--r--luni/src/main/java/java/io/Console.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/luni/src/main/java/java/io/Console.java b/luni/src/main/java/java/io/Console.java
index 1fd666b..a1d2097 100644
--- a/luni/src/main/java/java/io/Console.java
+++ b/luni/src/main/java/java/io/Console.java
@@ -47,15 +47,15 @@ public final class Console implements Flushable {
return null;
}
try {
- return new Console();
+ return new Console(System.in, System.out);
} catch (IOException ex) {
throw new AssertionError(ex);
}
}
- private Console() throws IOException {
- this.reader = new ConsoleReader(System.in);
- this.writer = new ConsoleWriter(System.out);
+ private Console(InputStream in, OutputStream out) throws IOException {
+ this.reader = new ConsoleReader(in);
+ this.writer = new ConsoleWriter(out);
}
public void flush() {