mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-17 19:37:18 +01:00
47 lines
1.5 KiB
Java
47 lines
1.5 KiB
Java
package com.amazonaws.internal;
|
|
|
|
import java.io.IOException;
|
|
import java.io.InputStream;
|
|
import java.security.DigestInputStream;
|
|
import java.security.MessageDigest;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes.dex */
|
|
public class SdkDigestInputStream extends DigestInputStream implements MetricAware {
|
|
static final /* synthetic */ boolean $assertionsDisabled = false;
|
|
private static final int SKIP_BUF_SIZE = 2048;
|
|
|
|
public SdkDigestInputStream(InputStream inputStream, MessageDigest messageDigest) {
|
|
super(inputStream, messageDigest);
|
|
}
|
|
|
|
@Override // com.amazonaws.internal.MetricAware
|
|
@Deprecated
|
|
public final boolean isMetricActivated() {
|
|
if (((DigestInputStream) this).in instanceof MetricAware) {
|
|
return ((MetricAware) ((DigestInputStream) this).in).isMetricActivated();
|
|
}
|
|
return false;
|
|
}
|
|
|
|
@Override // java.io.FilterInputStream, java.io.InputStream
|
|
public final long skip(long j) throws IOException {
|
|
if (j <= 0) {
|
|
return j;
|
|
}
|
|
int min = (int) Math.min(2048L, j);
|
|
byte[] bArr = new byte[min];
|
|
long j2 = j;
|
|
while (j2 > 0) {
|
|
int read = read(bArr, 0, (int) Math.min(j2, min));
|
|
if (read == -1) {
|
|
if (j2 == j) {
|
|
return -1L;
|
|
}
|
|
return j - j2;
|
|
}
|
|
j2 -= read;
|
|
}
|
|
return j;
|
|
}
|
|
}
|