.class public final Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder; .super Lcom/google/protobuf/CodedOutputStream; .source "SourceFile" # annotations .annotation system Ldalvik/annotation/EnclosingClass; value = Lcom/google/protobuf/CodedOutputStream; .end annotation .annotation system Ldalvik/annotation/InnerClass; accessFlags = 0x19 name = "UnsafeDirectNioEncoder" .end annotation # instance fields .field private final address:J .field private final buffer:Ljava/nio/ByteBuffer; .field private final initialPosition:J .field private final limit:J .field private final oneVarintLimit:J .field private final originalBuffer:Ljava/nio/ByteBuffer; .field private position:J # direct methods .method public constructor (Ljava/nio/ByteBuffer;)V .locals 6 const/4 v0, 0x0 .line 1864 invoke-direct {p0, v0}, Lcom/google/protobuf/CodedOutputStream;->(Lcom/google/protobuf/CodedOutputStream$1;)V iput-object p1, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->originalBuffer:Ljava/nio/ByteBuffer; .line 1866 invoke-virtual {p1}, Ljava/nio/ByteBuffer;->duplicate()Ljava/nio/ByteBuffer; move-result-object v0 sget-object v1, Ljava/nio/ByteOrder;->LITTLE_ENDIAN:Ljava/nio/ByteOrder; invoke-virtual {v0, v1}, Ljava/nio/ByteBuffer;->order(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer; move-result-object v0 iput-object v0, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->buffer:Ljava/nio/ByteBuffer; .line 1867 invoke-static {p1}, Lcom/google/protobuf/UnsafeUtil;->addressOffset(Ljava/nio/ByteBuffer;)J move-result-wide v0 iput-wide v0, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->address:J .line 1868 invoke-virtual {p1}, Ljava/nio/Buffer;->position()I move-result v2 int-to-long v2, v2 add-long/2addr v2, v0 iput-wide v2, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->initialPosition:J .line 1869 invoke-virtual {p1}, Ljava/nio/Buffer;->limit()I move-result p1 int-to-long v4, p1 add-long/2addr v0, v4 iput-wide v0, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->limit:J const-wide/16 v4, 0xa sub-long/2addr v0, v4 iput-wide v0, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->oneVarintLimit:J iput-wide v2, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J return-void .end method .method private bufferPos(J)I .locals 2 iget-wide v0, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->address:J sub-long/2addr p1, v0 long-to-int p1, p1 return p1 .end method .method public static isSupported()Z .locals 1 .line 1875 invoke-static {}, Lcom/google/protobuf/UnsafeUtil;->hasUnsafeByteBufferOperations()Z move-result v0 return v0 .end method .method private repositionBuffer(J)V .locals 1 iget-object v0, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->buffer:Ljava/nio/ByteBuffer; .line 2204 invoke-direct {p0, p1, p2}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->bufferPos(J)I move-result p1 invoke-virtual {v0, p1}, Ljava/nio/ByteBuffer;->position(I)Ljava/nio/Buffer; move-result-object p1 check-cast p1, Ljava/nio/ByteBuffer; return-void .end method # virtual methods .method public flush()V .locals 3 iget-object v0, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->originalBuffer:Ljava/nio/ByteBuffer; iget-wide v1, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J .line 2190 invoke-direct {p0, v1, v2}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->bufferPos(J)I move-result v1 invoke-virtual {v0, v1}, Ljava/nio/ByteBuffer;->position(I)Ljava/nio/Buffer; move-result-object v0 check-cast v0, Ljava/nio/ByteBuffer; return-void .end method .method public getTotalBytesWritten()I .locals 4 iget-wide v0, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J iget-wide v2, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->initialPosition:J sub-long/2addr v0, v2 long-to-int v0, v0 return v0 .end method .method public spaceLeft()I .locals 4 iget-wide v0, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->limit:J iget-wide v2, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J sub-long/2addr v0, v2 long-to-int v0, v0 return v0 .end method .method public write(B)V .locals 4 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation iget-wide v0, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J iget-wide v2, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->limit:J cmp-long v2, v0, v2 if-gez v2, :cond_0 const-wide/16 v2, 0x1 add-long/2addr v2, v0 iput-wide v2, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J .line 1996 invoke-static {v0, v1, p1}, Lcom/google/protobuf/UnsafeUtil;->putByte(JB)V return-void .line 1993 :cond_0 new-instance p1, Lcom/google/protobuf/CodedOutputStream$OutOfSpaceException; iget-wide v0, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J .line 1994 invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; move-result-object v0 iget-wide v1, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->limit:J invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; move-result-object v1 const/4 v2, 0x1 invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v2 filled-new-array {v0, v1, v2}, [Ljava/lang/Object; move-result-object v0 const-string v1, "Pos: %d, limit: %d, len: %d" invoke-static {v1, v0}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String; move-result-object v0 invoke-direct {p1, v0}, Lcom/google/protobuf/CodedOutputStream$OutOfSpaceException;->(Ljava/lang/String;)V throw p1 .end method .method public write(Ljava/nio/ByteBuffer;)V .locals 5 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 2126 :try_start_0 invoke-virtual {p1}, Ljava/nio/Buffer;->remaining()I move-result v0 iget-wide v1, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J .line 2127 invoke-direct {p0, v1, v2}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->repositionBuffer(J)V iget-object v1, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->buffer:Ljava/nio/ByteBuffer; .line 2128 invoke-virtual {v1, p1}, Ljava/nio/ByteBuffer;->put(Ljava/nio/ByteBuffer;)Ljava/nio/ByteBuffer; iget-wide v1, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J int-to-long v3, v0 add-long/2addr v1, v3 iput-wide v1, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J :try_end_0 .catch Ljava/nio/BufferOverflowException; {:try_start_0 .. :try_end_0} :catch_0 return-void :catch_0 move-exception p1 .line 2131 new-instance v0, Lcom/google/protobuf/CodedOutputStream$OutOfSpaceException; invoke-direct {v0, p1}, Lcom/google/protobuf/CodedOutputStream$OutOfSpaceException;->(Ljava/lang/Throwable;)V throw v0 .end method .method public write([BII)V .locals 11 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation if-eqz p1, :cond_1 if-ltz p2, :cond_1 if-ltz p3, :cond_1 .line 2102 array-length v0, p1 sub-int/2addr v0, p3 if-lt v0, p2, :cond_1 iget-wide v0, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->limit:J int-to-long v9, p3 sub-long/2addr v0, v9 iget-wide v5, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J cmp-long v0, v0, v5 if-gez v0, :cond_0 goto :goto_0 :cond_0 int-to-long v3, p2 move-object v2, p1 move-wide v7, v9 .line 2114 invoke-static/range {v2 .. v8}, Lcom/google/protobuf/UnsafeUtil;->copyMemory([BJJJ)V iget-wide p1, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J add-long/2addr p1, v9 iput-wide p1, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J return-void :cond_1 :goto_0 if-nez p1, :cond_2 .line 2108 new-instance p1, Ljava/lang/NullPointerException; const-string p2, "value" invoke-direct {p1, p2}, Ljava/lang/NullPointerException;->(Ljava/lang/String;)V throw p1 .line 2110 :cond_2 new-instance p1, Lcom/google/protobuf/CodedOutputStream$OutOfSpaceException; iget-wide v0, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J .line 2111 invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; move-result-object p2 iget-wide v0, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->limit:J invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; move-result-object v0 invoke-static {p3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object p3 filled-new-array {p2, v0, p3}, [Ljava/lang/Object; move-result-object p2 const-string p3, "Pos: %d, limit: %d, len: %d" invoke-static {p3, p2}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String; move-result-object p2 invoke-direct {p1, p2}, Lcom/google/protobuf/CodedOutputStream$OutOfSpaceException;->(Ljava/lang/String;)V throw p1 .end method .method public writeBool(IZ)V .locals 1 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation const/4 v0, 0x0 .line 1915 invoke-virtual {p0, p1, v0}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeTag(II)V int-to-byte p1, p2 .line 1916 invoke-virtual {p0, p1}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->write(B)V return-void .end method .method public writeByteArray(I[B)V .locals 2 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 1933 array-length v0, p2 const/4 v1, 0x0 invoke-virtual {p0, p1, p2, v1, v0}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeByteArray(I[BII)V return-void .end method .method public writeByteArray(I[BII)V .locals 1 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation const/4 v0, 0x2 .line 1939 invoke-virtual {p0, p1, v0}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeTag(II)V .line 1940 invoke-virtual {p0, p2, p3, p4}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeByteArrayNoTag([BII)V return-void .end method .method public writeByteArrayNoTag([BII)V .locals 0 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 2007 invoke-virtual {p0, p3}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeUInt32NoTag(I)V .line 2008 invoke-virtual {p0, p1, p2, p3}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->write([BII)V return-void .end method .method public writeByteBuffer(ILjava/nio/ByteBuffer;)V .locals 1 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation const/4 v0, 0x2 .line 1945 invoke-virtual {p0, p1, v0}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeTag(II)V .line 1946 invoke-virtual {p2}, Ljava/nio/Buffer;->capacity()I move-result p1 invoke-virtual {p0, p1}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeUInt32NoTag(I)V .line 1947 invoke-virtual {p0, p2}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeRawBytes(Ljava/nio/ByteBuffer;)V return-void .end method .method public writeBytes(ILcom/google/protobuf/ByteString;)V .locals 1 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation const/4 v0, 0x2 .line 1927 invoke-virtual {p0, p1, v0}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeTag(II)V .line 1928 invoke-virtual {p0, p2}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeBytesNoTag(Lcom/google/protobuf/ByteString;)V return-void .end method .method public writeBytesNoTag(Lcom/google/protobuf/ByteString;)V .locals 1 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 2001 invoke-virtual {p1}, Lcom/google/protobuf/ByteString;->size()I move-result v0 invoke-virtual {p0, v0}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeUInt32NoTag(I)V .line 2002 invoke-virtual {p1, p0}, Lcom/google/protobuf/ByteString;->writeTo(Lcom/google/protobuf/ByteOutput;)V return-void .end method .method public writeFixed32(II)V .locals 1 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation const/4 v0, 0x5 .line 1897 invoke-virtual {p0, p1, v0}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeTag(II)V .line 1898 invoke-virtual {p0, p2}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeFixed32NoTag(I)V return-void .end method .method public writeFixed32NoTag(I)V .locals 4 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation iget-object v0, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->buffer:Ljava/nio/ByteBuffer; iget-wide v1, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J .line 2062 invoke-direct {p0, v1, v2}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->bufferPos(J)I move-result v1 invoke-virtual {v0, v1, p1}, Ljava/nio/ByteBuffer;->putInt(II)Ljava/nio/ByteBuffer; iget-wide v0, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J const-wide/16 v2, 0x4 add-long/2addr v0, v2 iput-wide v0, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J return-void .end method .method public writeFixed64(IJ)V .locals 1 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation const/4 v0, 0x1 .line 1909 invoke-virtual {p0, p1, v0}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeTag(II)V .line 1910 invoke-virtual {p0, p2, p3}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeFixed64NoTag(J)V return-void .end method .method public writeFixed64NoTag(J)V .locals 3 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation iget-object v0, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->buffer:Ljava/nio/ByteBuffer; iget-wide v1, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J .line 2096 invoke-direct {p0, v1, v2}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->bufferPos(J)I move-result v1 invoke-virtual {v0, v1, p1, p2}, Ljava/nio/ByteBuffer;->putLong(IJ)Ljava/nio/ByteBuffer; iget-wide p1, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J const-wide/16 v0, 0x8 add-long/2addr p1, v0 iput-wide p1, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J return-void .end method .method public writeInt32(II)V .locals 1 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation const/4 v0, 0x0 .line 1885 invoke-virtual {p0, p1, v0}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeTag(II)V .line 1886 invoke-virtual {p0, p2}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeInt32NoTag(I)V return-void .end method .method public writeInt32NoTag(I)V .locals 2 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation if-ltz p1, :cond_0 .line 2025 invoke-virtual {p0, p1}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeUInt32NoTag(I)V goto :goto_0 :cond_0 int-to-long v0, p1 .line 2028 invoke-virtual {p0, v0, v1}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeUInt64NoTag(J)V :goto_0 return-void .end method .method public writeLazy(Ljava/nio/ByteBuffer;)V .locals 0 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 2137 invoke-virtual {p0, p1}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->write(Ljava/nio/ByteBuffer;)V return-void .end method .method public writeLazy([BII)V .locals 0 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 2120 invoke-virtual {p0, p1, p2, p3}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->write([BII)V return-void .end method .method public writeMessage(ILcom/google/protobuf/MessageLite;)V .locals 1 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation const/4 v0, 0x2 .line 1952 invoke-virtual {p0, p1, v0}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeTag(II)V .line 1953 invoke-virtual {p0, p2}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeMessageNoTag(Lcom/google/protobuf/MessageLite;)V return-void .end method .method public writeMessage(ILcom/google/protobuf/MessageLite;Lcom/google/protobuf/Schema;)V .locals 1 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation const/4 v0, 0x2 .line 1958 invoke-virtual {p0, p1, v0}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeTag(II)V .line 1959 invoke-virtual {p0, p2, p3}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeMessageNoTag(Lcom/google/protobuf/MessageLite;Lcom/google/protobuf/Schema;)V return-void .end method .method public writeMessageNoTag(Lcom/google/protobuf/MessageLite;)V .locals 1 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 1980 invoke-interface {p1}, Lcom/google/protobuf/MessageLite;->getSerializedSize()I move-result v0 invoke-virtual {p0, v0}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeUInt32NoTag(I)V .line 1981 invoke-interface {p1, p0}, Lcom/google/protobuf/MessageLite;->writeTo(Lcom/google/protobuf/CodedOutputStream;)V return-void .end method .method public writeMessageNoTag(Lcom/google/protobuf/MessageLite;Lcom/google/protobuf/Schema;)V .locals 1 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 1986 move-object v0, p1 check-cast v0, Lcom/google/protobuf/AbstractMessageLite; invoke-virtual {v0, p2}, Lcom/google/protobuf/AbstractMessageLite;->getSerializedSize(Lcom/google/protobuf/Schema;)I move-result v0 invoke-virtual {p0, v0}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeUInt32NoTag(I)V iget-object v0, p0, Lcom/google/protobuf/CodedOutputStream;->wrapper:Lcom/google/protobuf/CodedOutputStreamWriter; .line 1987 invoke-interface {p2, p1, v0}, Lcom/google/protobuf/Schema;->writeTo(Ljava/lang/Object;Lcom/google/protobuf/Writer;)V return-void .end method .method public writeMessageSetExtension(ILcom/google/protobuf/MessageLite;)V .locals 3 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation const/4 v0, 0x1 const/4 v1, 0x3 .line 1964 invoke-virtual {p0, v0, v1}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeTag(II)V const/4 v2, 0x2 .line 1965 invoke-virtual {p0, v2, p1}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeUInt32(II)V .line 1966 invoke-virtual {p0, v1, p2}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeMessage(ILcom/google/protobuf/MessageLite;)V const/4 p1, 0x4 .line 1967 invoke-virtual {p0, v0, p1}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeTag(II)V return-void .end method .method public writeRawBytes(Ljava/nio/ByteBuffer;)V .locals 2 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 2013 invoke-virtual {p1}, Ljava/nio/ByteBuffer;->hasArray()Z move-result v0 if-eqz v0, :cond_0 .line 2014 invoke-virtual {p1}, Ljava/nio/ByteBuffer;->array()[B move-result-object v0 invoke-virtual {p1}, Ljava/nio/ByteBuffer;->arrayOffset()I move-result v1 invoke-virtual {p1}, Ljava/nio/Buffer;->capacity()I move-result p1 invoke-virtual {p0, v0, v1, p1}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->write([BII)V goto :goto_0 .line 2016 :cond_0 invoke-virtual {p1}, Ljava/nio/ByteBuffer;->duplicate()Ljava/nio/ByteBuffer; move-result-object p1 .line 2017 invoke-virtual {p1}, Ljava/nio/ByteBuffer;->clear()Ljava/nio/Buffer; move-result-object v0 check-cast v0, Ljava/nio/ByteBuffer; .line 2018 invoke-virtual {p0, p1}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->write(Ljava/nio/ByteBuffer;)V :goto_0 return-void .end method .method public writeRawMessageSetExtension(ILcom/google/protobuf/ByteString;)V .locals 3 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation const/4 v0, 0x1 const/4 v1, 0x3 .line 1972 invoke-virtual {p0, v0, v1}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeTag(II)V const/4 v2, 0x2 .line 1973 invoke-virtual {p0, v2, p1}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeUInt32(II)V .line 1974 invoke-virtual {p0, v1, p2}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeBytes(ILcom/google/protobuf/ByteString;)V const/4 p1, 0x4 .line 1975 invoke-virtual {p0, v0, p1}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeTag(II)V return-void .end method .method public writeString(ILjava/lang/String;)V .locals 1 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation const/4 v0, 0x2 .line 1921 invoke-virtual {p0, p1, v0}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeTag(II)V .line 1922 invoke-virtual {p0, p2}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeStringNoTag(Ljava/lang/String;)V return-void .end method .method public writeStringNoTag(Ljava/lang/String;)V .locals 7 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation iget-wide v0, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J .line 2146 :try_start_0 invoke-virtual {p1}, Ljava/lang/String;->length()I move-result v2 mul-int/lit8 v2, v2, 0x3 .line 2147 invoke-static {v2}, Lcom/google/protobuf/CodedOutputStream;->computeUInt32SizeNoTag(I)I move-result v2 .line 2148 invoke-virtual {p1}, Ljava/lang/String;->length()I move-result v3 invoke-static {v3}, Lcom/google/protobuf/CodedOutputStream;->computeUInt32SizeNoTag(I)I move-result v3 if-ne v3, v2, :cond_0 iget-wide v4, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J .line 2152 invoke-direct {p0, v4, v5}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->bufferPos(J)I move-result v2 add-int/2addr v2, v3 iget-object v3, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->buffer:Ljava/nio/ByteBuffer; .line 2153 invoke-virtual {v3, v2}, Ljava/nio/ByteBuffer;->position(I)Ljava/nio/Buffer; move-result-object v3 check-cast v3, Ljava/nio/ByteBuffer; iget-object v3, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->buffer:Ljava/nio/ByteBuffer; .line 2156 invoke-static {p1, v3}, Lcom/google/protobuf/Utf8;->encodeUtf8(Ljava/lang/CharSequence;Ljava/nio/ByteBuffer;)V iget-object v3, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->buffer:Ljava/nio/ByteBuffer; .line 2159 invoke-virtual {v3}, Ljava/nio/Buffer;->position()I move-result v3 sub-int/2addr v3, v2 .line 2160 invoke-virtual {p0, v3}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeUInt32NoTag(I)V iget-wide v4, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J int-to-long v2, v3 add-long/2addr v4, v2 iput-wide v4, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J goto :goto_3 :catch_0 move-exception p1 goto :goto_0 :catch_1 move-exception p1 goto :goto_1 :catch_2 move-exception v2 goto :goto_2 .line 2164 :cond_0 invoke-static {p1}, Lcom/google/protobuf/Utf8;->encodedLength(Ljava/lang/CharSequence;)I move-result v2 .line 2165 invoke-virtual {p0, v2}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeUInt32NoTag(I)V iget-wide v3, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J .line 2168 invoke-direct {p0, v3, v4}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->repositionBuffer(J)V iget-object v3, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->buffer:Ljava/nio/ByteBuffer; .line 2169 invoke-static {p1, v3}, Lcom/google/protobuf/Utf8;->encodeUtf8(Ljava/lang/CharSequence;Ljava/nio/ByteBuffer;)V iget-wide v3, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J int-to-long v5, v2 add-long/2addr v3, v5 iput-wide v3, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J :try_end_0 .catch Lcom/google/protobuf/Utf8$UnpairedSurrogateException; {:try_start_0 .. :try_end_0} :catch_2 .catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_1 .catch Ljava/lang/IndexOutOfBoundsException; {:try_start_0 .. :try_end_0} :catch_0 goto :goto_3 .line 2183 :goto_0 new-instance v0, Lcom/google/protobuf/CodedOutputStream$OutOfSpaceException; invoke-direct {v0, p1}, Lcom/google/protobuf/CodedOutputStream$OutOfSpaceException;->(Ljava/lang/Throwable;)V throw v0 .line 2181 :goto_1 new-instance v0, Lcom/google/protobuf/CodedOutputStream$OutOfSpaceException; invoke-direct {v0, p1}, Lcom/google/protobuf/CodedOutputStream$OutOfSpaceException;->(Ljava/lang/Throwable;)V throw v0 :goto_2 iput-wide v0, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J .line 2175 invoke-direct {p0, v0, v1}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->repositionBuffer(J)V .line 2178 invoke-virtual {p0, p1, v2}, Lcom/google/protobuf/CodedOutputStream;->inefficientWriteStringNoTag(Ljava/lang/String;Lcom/google/protobuf/Utf8$UnpairedSurrogateException;)V :goto_3 return-void .end method .method public writeTag(II)V .locals 0 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 1880 invoke-static {p1, p2}, Lcom/google/protobuf/WireFormat;->makeTag(II)I move-result p1 invoke-virtual {p0, p1}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeUInt32NoTag(I)V return-void .end method .method public writeUInt32(II)V .locals 1 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation const/4 v0, 0x0 .line 1891 invoke-virtual {p0, p1, v0}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeTag(II)V .line 1892 invoke-virtual {p0, p2}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeUInt32NoTag(I)V return-void .end method .method public writeUInt32NoTag(I)V .locals 7 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation iget-wide v0, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J iget-wide v2, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->oneVarintLimit:J cmp-long v0, v0, v2 const-wide/16 v1, 0x1 if-gtz v0, :cond_1 :goto_0 and-int/lit8 v0, p1, -0x80 if-nez v0, :cond_0 iget-wide v3, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J add-long/2addr v1, v3 iput-wide v1, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J int-to-byte p1, p1 .line 2038 invoke-static {v3, v4, p1}, Lcom/google/protobuf/UnsafeUtil;->putByte(JB)V return-void :cond_0 iget-wide v3, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J add-long v5, v3, v1 iput-wide v5, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J and-int/lit8 v0, p1, 0x7f or-int/lit16 v0, v0, 0x80 int-to-byte v0, v0 .line 2041 invoke-static {v3, v4, v0}, Lcom/google/protobuf/UnsafeUtil;->putByte(JB)V ushr-int/lit8 p1, p1, 0x7 goto :goto_0 :cond_1 :goto_1 iget-wide v3, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J iget-wide v5, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->limit:J cmp-long v0, v3, v5 if-gez v0, :cond_3 and-int/lit8 v0, p1, -0x80 if-nez v0, :cond_2 add-long/2addr v1, v3 iput-wide v1, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J int-to-byte p1, p1 .line 2048 invoke-static {v3, v4, p1}, Lcom/google/protobuf/UnsafeUtil;->putByte(JB)V return-void :cond_2 add-long v5, v3, v1 iput-wide v5, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J and-int/lit8 v0, p1, 0x7f or-int/lit16 v0, v0, 0x80 int-to-byte v0, v0 .line 2051 invoke-static {v3, v4, v0}, Lcom/google/protobuf/UnsafeUtil;->putByte(JB)V ushr-int/lit8 p1, p1, 0x7 goto :goto_1 .line 2055 :cond_3 new-instance p1, Lcom/google/protobuf/CodedOutputStream$OutOfSpaceException; iget-wide v0, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J .line 2056 invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; move-result-object v0 iget-wide v1, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->limit:J invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; move-result-object v1 const/4 v2, 0x1 invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v2 filled-new-array {v0, v1, v2}, [Ljava/lang/Object; move-result-object v0 const-string v1, "Pos: %d, limit: %d, len: %d" invoke-static {v1, v0}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String; move-result-object v0 invoke-direct {p1, v0}, Lcom/google/protobuf/CodedOutputStream$OutOfSpaceException;->(Ljava/lang/String;)V throw p1 .end method .method public writeUInt64(IJ)V .locals 1 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation const/4 v0, 0x0 .line 1903 invoke-virtual {p0, p1, v0}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeTag(II)V .line 1904 invoke-virtual {p0, p2, p3}, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->writeUInt64NoTag(J)V return-void .end method .method public writeUInt64NoTag(J)V .locals 12 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation iget-wide v0, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J iget-wide v2, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->oneVarintLimit:J cmp-long v0, v0, v2 const/4 v1, 0x7 const-wide/16 v2, 0x0 const-wide/16 v4, -0x80 const-wide/16 v6, 0x1 if-gtz v0, :cond_1 :goto_0 and-long v8, p1, v4 cmp-long v0, v8, v2 if-nez v0, :cond_0 iget-wide v0, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J add-long/2addr v6, v0 iput-wide v6, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J long-to-int p1, p1 int-to-byte p1, p1 .line 2072 invoke-static {v0, v1, p1}, Lcom/google/protobuf/UnsafeUtil;->putByte(JB)V return-void :cond_0 iget-wide v8, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J add-long v10, v8, v6 iput-wide v10, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J long-to-int v0, p1 and-int/lit8 v0, v0, 0x7f or-int/lit16 v0, v0, 0x80 int-to-byte v0, v0 .line 2075 invoke-static {v8, v9, v0}, Lcom/google/protobuf/UnsafeUtil;->putByte(JB)V ushr-long/2addr p1, v1 goto :goto_0 :cond_1 :goto_1 iget-wide v8, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J iget-wide v10, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->limit:J cmp-long v0, v8, v10 if-gez v0, :cond_3 and-long v10, p1, v4 cmp-long v0, v10, v2 if-nez v0, :cond_2 add-long/2addr v6, v8 iput-wide v6, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J long-to-int p1, p1 int-to-byte p1, p1 .line 2082 invoke-static {v8, v9, p1}, Lcom/google/protobuf/UnsafeUtil;->putByte(JB)V return-void :cond_2 add-long v10, v8, v6 iput-wide v10, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J long-to-int v0, p1 and-int/lit8 v0, v0, 0x7f or-int/lit16 v0, v0, 0x80 int-to-byte v0, v0 .line 2085 invoke-static {v8, v9, v0}, Lcom/google/protobuf/UnsafeUtil;->putByte(JB)V ushr-long/2addr p1, v1 goto :goto_1 .line 2089 :cond_3 new-instance p1, Lcom/google/protobuf/CodedOutputStream$OutOfSpaceException; iget-wide v0, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->position:J .line 2090 invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; move-result-object p2 iget-wide v0, p0, Lcom/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder;->limit:J invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; move-result-object v0 const/4 v1, 0x1 invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v1 filled-new-array {p2, v0, v1}, [Ljava/lang/Object; move-result-object p2 const-string v0, "Pos: %d, limit: %d, len: %d" invoke-static {v0, p2}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String; move-result-object p2 invoke-direct {p1, p2}, Lcom/google/protobuf/CodedOutputStream$OutOfSpaceException;->(Ljava/lang/String;)V throw p1 .end method