Files
rr3-apk/decompiled/sources/com/google/android/gms/common/util/DataUtils.java
Daniel Elliott f9d20bb3fc Add decompiled APK source code (JADX)
- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-18 14:52:23 -08:00

37 lines
1.2 KiB
Java

package com.google.android.gms.common.util;
import android.database.CharArrayBuffer;
import android.graphics.Bitmap;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.android.gms.common.annotation.KeepForSdk;
import java.io.ByteArrayOutputStream;
@KeepForSdk
/* loaded from: classes2.dex */
public final class DataUtils {
@KeepForSdk
public static void copyStringToBuffer(@Nullable String str, @NonNull CharArrayBuffer charArrayBuffer) {
if (TextUtils.isEmpty(str)) {
charArrayBuffer.sizeCopied = 0;
return;
}
char[] cArr = charArrayBuffer.data;
if (cArr == null || cArr.length < str.length()) {
charArrayBuffer.data = str.toCharArray();
} else {
str.getChars(0, str.length(), charArrayBuffer.data, 0);
}
charArrayBuffer.sizeCopied = str.length();
}
@NonNull
@KeepForSdk
public static byte[] loadImageBytes(@NonNull Bitmap bitmap) {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, byteArrayOutputStream);
return byteArrayOutputStream.toByteArray();
}
}