ImageFormatCheckerUtils.smali

.class public Lcom/facebook/imageformat/ImageFormatCheckerUtils;
.super Ljava/lang/Object;
.source "SourceFile"


# direct methods
.method private constructor <init>()V
    .registers 1

    .line 102
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static asciiBytes(Ljava/lang/String;)[B
    .registers 3

    .line 25
    invoke-static {p0}, Lcom/facebook/common/internal/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;

    :try_start_3
    const-string v0, "ASCII"

    .line 27
    invoke-virtual {p0, v0}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B

    move-result-object p0
    :try_end_9
    .catch Ljava/io/UnsupportedEncodingException; {:try_start_3 .. :try_end_9} :catch_a

    return-object p0

    :catch_a
    move-exception p0

    .line 30
    new-instance v0, Ljava/lang/RuntimeException;

    const-string v1, "ASCII not found!"

    invoke-direct {v0, v1, p0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V

    throw v0
.end method

.method public static indexOfPattern([BI[BI)I
    .registers 12

    .line 70
    invoke-static {p0}, Lcom/facebook/common/internal/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;

    .line 71
    invoke-static {p2}, Lcom/facebook/common/internal/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;

    const/4 v0, -0x1

    if-le p3, p1, :cond_a

    return v0

    :cond_a
    const/4 v1, 0x0

    .line 76
    aget-byte v2, p2, v1

    sub-int/2addr p1, p3

    :goto_e
    if-gt v1, p1, :cond_36

    .line 81
    aget-byte v3, p0, v1

    const/4 v4, 0x1

    if-eq v3, v2, :cond_1c

    :cond_15
    add-int/2addr v1, v4

    if-gt v1, p1, :cond_1c

    .line 82
    aget-byte v3, p0, v1

    if-ne v3, v2, :cond_15

    :cond_1c
    if-gt v1, p1, :cond_33

    add-int/lit8 v3, v1, 0x1

    add-int v5, v3, p3

    sub-int/2addr v5, v4

    :goto_23
    if-ge v3, v5, :cond_30

    .line 90
    aget-byte v6, p0, v3

    aget-byte v7, p2, v4

    if-ne v6, v7, :cond_30

    add-int/lit8 v3, v3, 0x1

    add-int/lit8 v4, v4, 0x1

    goto :goto_23

    :cond_30
    if-ne v3, v5, :cond_33

    return v1

    :cond_33
    add-int/lit8 v1, v1, 0x1

    goto :goto_e

    :cond_36
    return v0
.end method

.method public static startsWithPattern([B[B)Z
    .registers 6

    .line 44
    invoke-static {p0}, Lcom/facebook/common/internal/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;

    .line 45
    invoke-static {p1}, Lcom/facebook/common/internal/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;

    .line 46
    array-length v0, p1

    array-length v1, p0

    const/4 v2, 0x0

    if-le v0, v1, :cond_c

    return v2

    :cond_c
    const/4 v0, 0x0

    .line 50
    :goto_d
    array-length v1, p1

    if-ge v0, v1, :cond_1a

    .line 51
    aget-byte v1, p0, v0

    aget-byte v3, p1, v0

    if-eq v1, v3, :cond_17

    return v2

    :cond_17
    add-int/lit8 v0, v0, 0x1

    goto :goto_d

    :cond_1a
    const/4 p0, 0x1

    return p0
.end method