123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- package com.epson.mobilephone.common.license;
- import android.content.Context;
- import android.support.annotation.RawRes;
- import java.io.ByteArrayOutputStream;
- import java.io.IOException;
- import java.io.InputStream;
- /* renamed from: com.epson.mobilephone.common.license.Util */
- public class C1073Util {
- public static String getStringFromRawResource(@NonNull Context context, @RawRes int i) {
- InputStream openRawResource = context.getResources().openRawResource(i);
- try {
- String stringFromInputStream = getStringFromInputStream(openRawResource);
- if (openRawResource != null) {
- try {
- openRawResource.close();
- } catch (IOException unused) {
- }
- }
- return stringFromInputStream;
- } catch (IOException unused2) {
- if (openRawResource != null) {
- try {
- openRawResource.close();
- } catch (IOException unused3) {
- }
- }
- return "";
- }
- }
- public static String getStringFromInputStream(InputStream inputStream) throws IOException {
- ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
- byte[] bArr = new byte[1024];
- while (true) {
- int read = inputStream.read(bArr);
- if (read == -1) {
- return byteArrayOutputStream.toString();
- }
- byteArrayOutputStream.write(bArr, 0, read);
- }
- }
- }
|