package o; import android.graphics.Bitmap; import java.io.ByteArrayOutputStream; import java.io.IOException; /* loaded from: classes5.dex */ public final class fQO { public static byte[] a(Bitmap bitmap, Bitmap.CompressFormat compressFormat, Integer num) throws IOException { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); try { bitmap.compress(compressFormat, num.intValue(), byteArrayOutputStream); return byteArrayOutputStream.toByteArray(); } finally { byteArrayOutputStream.close(); } } }