blob: bd7c6809eca369ae7ec66b7ab14d4a1d4982322a [file] [log] [blame]
// Copyright (c) 2023, the R8 project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
package com.android.tools.r8.profile.art;
import com.android.tools.r8.DiagnosticsHandler;
import com.android.tools.r8.TextOutputStream;
import com.android.tools.r8.utils.UTF8TextOutputStream;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.nio.file.Path;
public class ArtProfileConsumerUtils {
public static ArtProfileConsumer create(Path rewrittenArtProfile) {
return new ArtProfileConsumer() {
@Override
public TextOutputStream getHumanReadableArtProfileConsumer() {
try {
return new UTF8TextOutputStream(rewrittenArtProfile);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
@Override
public void finished(DiagnosticsHandler handler) {
// Intentionally empty.
}
};
}
}