1package com.android.dx.command.dexer;
2
3import com.android.dx.dex.cf.CodeStatistics;
4import com.android.dx.dex.cf.OptimizerOptions;
5import java.io.IOException;
6import java.io.OutputStream;
7import java.io.PrintStream;
8
9/**
10 * State used by a single invocation of {@link Main}.
11 */
12public 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
26    public DxContext(OutputStream out, OutputStream err) {
27        this.out = new PrintStream(out);
28        this.err = new PrintStream(err);
29    }
30
31    public DxContext() {
32        this(System.out, System.err);
33    }
34}
35