106 lines
3.5 KiB
Java
106 lines
3.5 KiB
Java
package o;
|
|
|
|
import android.media.MediaDataSource;
|
|
import android.media.MediaMetadataRetriever;
|
|
import android.system.ErrnoException;
|
|
import java.io.FileDescriptor;
|
|
import java.io.IOException;
|
|
import java.io.InputStream;
|
|
import java.io.OutputStream;
|
|
|
|
/* loaded from: classes.dex */
|
|
final class gNH {
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static int a(InputStream inputStream, OutputStream outputStream) throws IOException {
|
|
byte[] bArr = new byte[8192];
|
|
int i = 0;
|
|
while (true) {
|
|
int read = inputStream.read(bArr);
|
|
if (read == -1) {
|
|
return i;
|
|
}
|
|
i += read;
|
|
outputStream.write(bArr, 0, read);
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static void e(InputStream inputStream, OutputStream outputStream, int i) throws IOException {
|
|
byte[] bArr = new byte[8192];
|
|
while (i > 0) {
|
|
int min = Math.min(i, 8192);
|
|
int read = inputStream.read(bArr, 0, min);
|
|
if (read != min) {
|
|
throw new IOException("Failed to copy the given amount of bytes from the inputstream to the output stream.");
|
|
}
|
|
i -= read;
|
|
outputStream.write(bArr, 0, read);
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static long[] c(Object obj) {
|
|
if (obj instanceof int[]) {
|
|
int[] iArr = (int[]) obj;
|
|
long[] jArr = new long[iArr.length];
|
|
for (int i = 0; i < iArr.length; i++) {
|
|
jArr[i] = iArr[i];
|
|
}
|
|
return jArr;
|
|
}
|
|
if (obj instanceof long[]) {
|
|
return (long[]) obj;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static boolean a(byte[] bArr, byte[] bArr2) {
|
|
if (bArr2 == null || bArr.length < bArr2.length) {
|
|
return false;
|
|
}
|
|
for (int i = 0; i < bArr2.length; i++) {
|
|
if (bArr[i] != bArr2[i]) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static String b(byte[] bArr) {
|
|
int length = bArr.length;
|
|
StringBuilder sb = new StringBuilder(8);
|
|
for (byte b : bArr) {
|
|
sb.append(String.format("%02x", Byte.valueOf(b)));
|
|
}
|
|
return sb.toString();
|
|
}
|
|
|
|
/* loaded from: classes.dex */
|
|
static class IeS {
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static FileDescriptor b(FileDescriptor fileDescriptor) throws ErrnoException {
|
|
return android.system.Os.dup(fileDescriptor);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static long c(FileDescriptor fileDescriptor, long j, int i) throws ErrnoException {
|
|
return android.system.Os.lseek(fileDescriptor, j, i);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static void c(FileDescriptor fileDescriptor) throws ErrnoException {
|
|
android.system.Os.close(fileDescriptor);
|
|
}
|
|
}
|
|
|
|
/* loaded from: classes.dex */
|
|
static class Sts {
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static void yh_(MediaMetadataRetriever mediaMetadataRetriever, MediaDataSource mediaDataSource) {
|
|
mediaMetadataRetriever.setDataSource(mediaDataSource);
|
|
}
|
|
}
|
|
}
|