110 lines
2.8 KiB
Smali
110 lines
2.8 KiB
Smali
.class public Lcom/fasterxml/jackson/databind/ser/std/ByteBufferSerializer;
|
|
.super Lcom/fasterxml/jackson/databind/ser/std/StdScalarSerializer;
|
|
.source "ByteBufferSerializer.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lcom/fasterxml/jackson/databind/ser/std/StdScalarSerializer<",
|
|
"Ljava/nio/ByteBuffer;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 1
|
|
|
|
.line 1
|
|
const-class v0, Ljava/nio/ByteBuffer;
|
|
|
|
invoke-direct {p0, v0}, Lcom/fasterxml/jackson/databind/ser/std/StdScalarSerializer;-><init>(Ljava/lang/Class;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public bridge synthetic serialize(Ljava/lang/Object;Lcom/fasterxml/jackson/core/JsonGenerator;Lcom/fasterxml/jackson/databind/SerializerProvider;)V
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
check-cast p1, Ljava/nio/ByteBuffer;
|
|
|
|
invoke-virtual {p0, p1, p2, p3}, Lcom/fasterxml/jackson/databind/ser/std/ByteBufferSerializer;->serialize(Ljava/nio/ByteBuffer;Lcom/fasterxml/jackson/core/JsonGenerator;Lcom/fasterxml/jackson/databind/SerializerProvider;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public serialize(Ljava/nio/ByteBuffer;Lcom/fasterxml/jackson/core/JsonGenerator;Lcom/fasterxml/jackson/databind/SerializerProvider;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 2
|
|
invoke-virtual {p1}, Ljava/nio/ByteBuffer;->hasArray()Z
|
|
|
|
move-result p3
|
|
|
|
if-eqz p3, :cond_0
|
|
|
|
.line 3
|
|
invoke-virtual {p1}, Ljava/nio/ByteBuffer;->array()[B
|
|
|
|
move-result-object p3
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-virtual {p1}, Ljava/nio/ByteBuffer;->limit()I
|
|
|
|
move-result p1
|
|
|
|
invoke-virtual {p2, p3, v0, p1}, Lcom/fasterxml/jackson/core/JsonGenerator;->writeBinary([BII)V
|
|
|
|
return-void
|
|
|
|
.line 4
|
|
:cond_0
|
|
invoke-virtual {p1}, Ljava/nio/ByteBuffer;->asReadOnlyBuffer()Ljava/nio/ByteBuffer;
|
|
|
|
move-result-object p1
|
|
|
|
.line 5
|
|
invoke-virtual {p1}, Ljava/nio/ByteBuffer;->position()I
|
|
|
|
move-result p3
|
|
|
|
if-lez p3, :cond_1
|
|
|
|
.line 6
|
|
invoke-virtual {p1}, Ljava/nio/ByteBuffer;->rewind()Ljava/nio/Buffer;
|
|
|
|
.line 7
|
|
:cond_1
|
|
new-instance p3, Lcom/fasterxml/jackson/databind/util/ByteBufferBackedInputStream;
|
|
|
|
invoke-direct {p3, p1}, Lcom/fasterxml/jackson/databind/util/ByteBufferBackedInputStream;-><init>(Ljava/nio/ByteBuffer;)V
|
|
|
|
.line 8
|
|
invoke-virtual {p1}, Ljava/nio/ByteBuffer;->remaining()I
|
|
|
|
move-result p1
|
|
|
|
invoke-virtual {p2, p3, p1}, Lcom/fasterxml/jackson/core/JsonGenerator;->writeBinary(Ljava/io/InputStream;I)I
|
|
|
|
.line 9
|
|
invoke-virtual {p3}, Ljava/io/InputStream;->close()V
|
|
|
|
return-void
|
|
.end method
|