Rabbit-R1/android (non root)/smali/smali_classes2/androidx/emoji2/text/flatbuffer/Utf8Old.smali
2024-05-21 17:08:36 -04:00

288 lines
7.6 KiB
Smali

.class public Landroidx/emoji2/text/flatbuffer/Utf8Old;
.super Landroidx/emoji2/text/flatbuffer/Utf8;
.source "Utf8Old.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Landroidx/emoji2/text/flatbuffer/Utf8Old$Cache;
}
.end annotation
# static fields
.field private static final CACHE:Ljava/lang/ThreadLocal;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/lang/ThreadLocal<",
"Landroidx/emoji2/text/flatbuffer/Utf8Old$Cache;",
">;"
}
.end annotation
.end field
# direct methods
.method static constructor <clinit>()V
.locals 1
.line 45
new-instance v0, Landroidx/emoji2/text/flatbuffer/Utf8Old$$ExternalSyntheticLambda0;
invoke-direct {v0}, Landroidx/emoji2/text/flatbuffer/Utf8Old$$ExternalSyntheticLambda0;-><init>()V
.line 46
invoke-static {v0}, Ljava/lang/ThreadLocal;->withInitial(Ljava/util/function/Supplier;)Ljava/lang/ThreadLocal;
move-result-object v0
sput-object v0, Landroidx/emoji2/text/flatbuffer/Utf8Old;->CACHE:Ljava/lang/ThreadLocal;
return-void
.end method
.method public constructor <init>()V
.locals 0
.line 31
invoke-direct {p0}, Landroidx/emoji2/text/flatbuffer/Utf8;-><init>()V
return-void
.end method
.method static synthetic lambda$static$0()Landroidx/emoji2/text/flatbuffer/Utf8Old$Cache;
.locals 1
.line 46
new-instance v0, Landroidx/emoji2/text/flatbuffer/Utf8Old$Cache;
invoke-direct {v0}, Landroidx/emoji2/text/flatbuffer/Utf8Old$Cache;-><init>()V
return-object v0
.end method
# virtual methods
.method public decodeUtf8(Ljava/nio/ByteBuffer;II)Ljava/lang/String;
.locals 0
sget-object p0, Landroidx/emoji2/text/flatbuffer/Utf8Old;->CACHE:Ljava/lang/ThreadLocal;
.line 87
invoke-virtual {p0}, Ljava/lang/ThreadLocal;->get()Ljava/lang/Object;
move-result-object p0
check-cast p0, Landroidx/emoji2/text/flatbuffer/Utf8Old$Cache;
iget-object p0, p0, Landroidx/emoji2/text/flatbuffer/Utf8Old$Cache;->decoder:Ljava/nio/charset/CharsetDecoder;
.line 88
invoke-virtual {p0}, Ljava/nio/charset/CharsetDecoder;->reset()Ljava/nio/charset/CharsetDecoder;
.line 89
invoke-virtual {p1}, Ljava/nio/ByteBuffer;->duplicate()Ljava/nio/ByteBuffer;
move-result-object p1
.line 90
invoke-virtual {p1, p2}, Ljava/nio/ByteBuffer;->position(I)Ljava/nio/Buffer;
add-int/2addr p2, p3
.line 91
invoke-virtual {p1, p2}, Ljava/nio/ByteBuffer;->limit(I)Ljava/nio/Buffer;
.line 93
:try_start_0
invoke-virtual {p0, p1}, Ljava/nio/charset/CharsetDecoder;->decode(Ljava/nio/ByteBuffer;)Ljava/nio/CharBuffer;
move-result-object p0
.line 94
invoke-virtual {p0}, Ljava/nio/CharBuffer;->toString()Ljava/lang/String;
move-result-object p0
:try_end_0
.catch Ljava/nio/charset/CharacterCodingException; {:try_start_0 .. :try_end_0} :catch_0
return-object p0
:catch_0
move-exception p0
.line 96
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string p2, "Bad encoding"
invoke-direct {p1, p2, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
throw p1
.end method
.method public encodeUtf8(Ljava/lang/CharSequence;Ljava/nio/ByteBuffer;)V
.locals 2
sget-object v0, Landroidx/emoji2/text/flatbuffer/Utf8Old;->CACHE:Ljava/lang/ThreadLocal;
.line 76
invoke-virtual {v0}, Ljava/lang/ThreadLocal;->get()Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroidx/emoji2/text/flatbuffer/Utf8Old$Cache;
.line 77
iget-object v1, v0, Landroidx/emoji2/text/flatbuffer/Utf8Old$Cache;->lastInput:Ljava/lang/CharSequence;
if-eq v1, p1, :cond_0
.line 80
invoke-virtual {p0, p1}, Landroidx/emoji2/text/flatbuffer/Utf8Old;->encodedLength(Ljava/lang/CharSequence;)I
.line 82
:cond_0
iget-object p0, v0, Landroidx/emoji2/text/flatbuffer/Utf8Old$Cache;->lastOutput:Ljava/nio/ByteBuffer;
invoke-virtual {p2, p0}, Ljava/nio/ByteBuffer;->put(Ljava/nio/ByteBuffer;)Ljava/nio/ByteBuffer;
return-void
.end method
.method public encodedLength(Ljava/lang/CharSequence;)I
.locals 3
sget-object p0, Landroidx/emoji2/text/flatbuffer/Utf8Old;->CACHE:Ljava/lang/ThreadLocal;
.line 53
invoke-virtual {p0}, Ljava/lang/ThreadLocal;->get()Ljava/lang/Object;
move-result-object p0
check-cast p0, Landroidx/emoji2/text/flatbuffer/Utf8Old$Cache;
.line 54
invoke-interface {p1}, Ljava/lang/CharSequence;->length()I
move-result v0
int-to-float v0, v0
iget-object v1, p0, Landroidx/emoji2/text/flatbuffer/Utf8Old$Cache;->encoder:Ljava/nio/charset/CharsetEncoder;
invoke-virtual {v1}, Ljava/nio/charset/CharsetEncoder;->maxBytesPerChar()F
move-result v1
mul-float/2addr v0, v1
float-to-int v0, v0
.line 55
iget-object v1, p0, Landroidx/emoji2/text/flatbuffer/Utf8Old$Cache;->lastOutput:Ljava/nio/ByteBuffer;
if-eqz v1, :cond_0
iget-object v1, p0, Landroidx/emoji2/text/flatbuffer/Utf8Old$Cache;->lastOutput:Ljava/nio/ByteBuffer;
invoke-virtual {v1}, Ljava/nio/ByteBuffer;->capacity()I
move-result v1
if-ge v1, v0, :cond_1
:cond_0
const/16 v1, 0x80
.line 56
invoke-static {v1, v0}, Ljava/lang/Math;->max(II)I
move-result v0
invoke-static {v0}, Ljava/nio/ByteBuffer;->allocate(I)Ljava/nio/ByteBuffer;
move-result-object v0
iput-object v0, p0, Landroidx/emoji2/text/flatbuffer/Utf8Old$Cache;->lastOutput:Ljava/nio/ByteBuffer;
.line 58
:cond_1
iget-object v0, p0, Landroidx/emoji2/text/flatbuffer/Utf8Old$Cache;->lastOutput:Ljava/nio/ByteBuffer;
invoke-virtual {v0}, Ljava/nio/ByteBuffer;->clear()Ljava/nio/Buffer;
.line 59
iput-object p1, p0, Landroidx/emoji2/text/flatbuffer/Utf8Old$Cache;->lastInput:Ljava/lang/CharSequence;
.line 60
instance-of v0, p1, Ljava/nio/CharBuffer;
if-eqz v0, :cond_2
check-cast p1, Ljava/nio/CharBuffer;
goto :goto_0
.line 61
:cond_2
invoke-static {p1}, Ljava/nio/CharBuffer;->wrap(Ljava/lang/CharSequence;)Ljava/nio/CharBuffer;
move-result-object p1
.line 62
:goto_0
iget-object v0, p0, Landroidx/emoji2/text/flatbuffer/Utf8Old$Cache;->encoder:Ljava/nio/charset/CharsetEncoder;
iget-object v1, p0, Landroidx/emoji2/text/flatbuffer/Utf8Old$Cache;->lastOutput:Ljava/nio/ByteBuffer;
const/4 v2, 0x1
invoke-virtual {v0, p1, v1, v2}, Ljava/nio/charset/CharsetEncoder;->encode(Ljava/nio/CharBuffer;Ljava/nio/ByteBuffer;Z)Ljava/nio/charset/CoderResult;
move-result-object p1
.line 63
invoke-virtual {p1}, Ljava/nio/charset/CoderResult;->isError()Z
move-result v0
if-eqz v0, :cond_3
.line 65
:try_start_0
invoke-virtual {p1}, Ljava/nio/charset/CoderResult;->throwException()V
:try_end_0
.catch Ljava/nio/charset/CharacterCodingException; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_1
:catch_0
move-exception p0
.line 67
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string v0, "bad character encoding"
invoke-direct {p1, v0, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
throw p1
.line 70
:cond_3
:goto_1
iget-object p1, p0, Landroidx/emoji2/text/flatbuffer/Utf8Old$Cache;->lastOutput:Ljava/nio/ByteBuffer;
invoke-virtual {p1}, Ljava/nio/ByteBuffer;->flip()Ljava/nio/Buffer;
.line 71
iget-object p0, p0, Landroidx/emoji2/text/flatbuffer/Utf8Old$Cache;->lastOutput:Ljava/nio/ByteBuffer;
invoke-virtual {p0}, Ljava/nio/ByteBuffer;->remaining()I
move-result p0
return p0
.end method