1 package com.android.dx.command.dexer;
2 
3 import com.android.dx.dex.cf.CodeStatistics;
4 import com.android.dx.dex.cf.OptimizerOptions;
5 import java.io.IOException;
6 import java.io.OutputStream;
7 import java.io.PrintStream;
8 
9 /**
10  * State used by a single invocation of {@link Main}.
11  */
12 public class DxContext {
13     public final CodeStatistics codeStatistics = new CodeStatistics();
14     public final OptimizerOptions optimizerOptions = new OptimizerOptions();
15     public final PrintStream out;
16     public final PrintStream err;
17 
18     @SuppressWarnings("IOResourceOpenedButNotSafelyClosed")
19     final PrintStream noop = new PrintStream(new OutputStream() {
20         @Override
21         public void write(int b) throws IOException {
22             // noop;
23         }
24     });
25 
DxContext(OutputStream out, OutputStream err)26     public DxContext(OutputStream out, OutputStream err) {
27         this.out = new PrintStream(out);
28         this.err = new PrintStream(err);
29     }
30 
DxContext()31     public DxContext() {
32         this(System.out, System.err);
33     }
34 }
35