jdk/src/jdk.jartool/share/classes/sun/tools/jar/Main.java
changeset 41484 834b7539ada3
parent 41221 eb0dc5ea2302
child 41754 8b7c8d5e9a0d
--- a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/Main.java	Wed Oct 12 14:31:17 2016 -0700
+++ b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/Main.java	Wed Oct 12 15:41:00 2016 -0700
@@ -76,7 +76,7 @@
 public
 class Main {
     String program;
-    PrintStream out, err;
+    PrintWriter out, err;
     String fname, mname, ename;
     String zname = "";
     String rootjar = null;
@@ -189,9 +189,9 @@
         USAGE_SUMMARY(GNUStyleOptions::printUsageSummary),
         VERSION(GNUStyleOptions::printVersion);
 
-        private Consumer<PrintStream> printFunction;
-        Info(Consumer<PrintStream> f) { this.printFunction = f; }
-        void print(PrintStream out) { printFunction.accept(out); }
+        private Consumer<PrintWriter> printFunction;
+        Info(Consumer<PrintWriter> f) { this.printFunction = f; }
+        void print(PrintWriter out) { printFunction.accept(out); }
     };
     Info info;
 
@@ -252,6 +252,12 @@
     }
 
     public Main(PrintStream out, PrintStream err, String program) {
+        this.out = new PrintWriter(out, true);
+        this.err = new PrintWriter(err, true);
+        this.program = program;
+    }
+
+    public Main(PrintWriter out, PrintWriter err, String program) {
         this.out = out;
         this.err = err;
         this.program = program;