2022-06-10 21:38:30 +09:00

114 lines
2.1 KiB
Smali

.class public final Lcom/coremedia/iso/Utf8;
.super Ljava/lang/Object;
.source "Utf8.java"
# direct methods
.method public constructor <init>()V
.locals 0
.line 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static convert([B)Ljava/lang/String;
.locals 2
if-eqz p0, :cond_0
.line 3
:try_start_0
new-instance v0, Ljava/lang/String;
const-string v1, "UTF-8"
invoke-direct {v0, p0, v1}, Ljava/lang/String;-><init>([BLjava/lang/String;)V
:try_end_0
.catch Ljava/io/UnsupportedEncodingException; {:try_start_0 .. :try_end_0} :catch_0
return-object v0
:catch_0
move-exception p0
.line 4
new-instance v0, Ljava/lang/Error;
invoke-direct {v0, p0}, Ljava/lang/Error;-><init>(Ljava/lang/Throwable;)V
throw v0
:cond_0
const/4 p0, 0x0
return-object p0
.end method
.method public static convert(Ljava/lang/String;)[B
.locals 1
if-eqz p0, :cond_0
:try_start_0
const-string v0, "UTF-8"
.line 1
invoke-virtual {p0, v0}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B
move-result-object p0
:try_end_0
.catch Ljava/io/UnsupportedEncodingException; {:try_start_0 .. :try_end_0} :catch_0
return-object p0
:catch_0
move-exception p0
.line 2
new-instance v0, Ljava/lang/Error;
invoke-direct {v0, p0}, Ljava/lang/Error;-><init>(Ljava/lang/Throwable;)V
throw v0
:cond_0
const/4 p0, 0x0
return-object p0
.end method
.method public static utf8StringLengthInBytes(Ljava/lang/String;)I
.locals 1
if-eqz p0, :cond_0
:try_start_0
const-string v0, "UTF-8"
.line 1
invoke-virtual {p0, v0}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B
move-result-object p0
array-length p0, p0
:try_end_0
.catch Ljava/io/UnsupportedEncodingException; {:try_start_0 .. :try_end_0} :catch_0
return p0
.line 2
:catch_0
new-instance p0, Ljava/lang/RuntimeException;
invoke-direct {p0}, Ljava/lang/RuntimeException;-><init>()V
throw p0
:cond_0
const/4 p0, 0x0
return p0
.end method