Header.smali 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. .class public final Lokhttp3/internal/http2/Header;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # static fields
  5. .field public static final PSEUDO_PREFIX:Lokio/ByteString;
  6. .field public static final RESPONSE_STATUS:Lokio/ByteString;
  7. .field public static final TARGET_AUTHORITY:Lokio/ByteString;
  8. .field public static final TARGET_METHOD:Lokio/ByteString;
  9. .field public static final TARGET_PATH:Lokio/ByteString;
  10. .field public static final TARGET_SCHEME:Lokio/ByteString;
  11. # instance fields
  12. .field final hpackSize:I
  13. .field public final name:Lokio/ByteString;
  14. .field public final value:Lokio/ByteString;
  15. # direct methods
  16. .method static constructor <clinit>()V
  17. .locals 1
  18. const-string v0, ":"
  19. invoke-static {v0}, Lokio/ByteString;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
  20. move-result-object v0
  21. sput-object v0, Lokhttp3/internal/http2/Header;->PSEUDO_PREFIX:Lokio/ByteString;
  22. const-string v0, ":status"
  23. invoke-static {v0}, Lokio/ByteString;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
  24. move-result-object v0
  25. sput-object v0, Lokhttp3/internal/http2/Header;->RESPONSE_STATUS:Lokio/ByteString;
  26. const-string v0, ":method"
  27. invoke-static {v0}, Lokio/ByteString;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
  28. move-result-object v0
  29. sput-object v0, Lokhttp3/internal/http2/Header;->TARGET_METHOD:Lokio/ByteString;
  30. const-string v0, ":path"
  31. invoke-static {v0}, Lokio/ByteString;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
  32. move-result-object v0
  33. sput-object v0, Lokhttp3/internal/http2/Header;->TARGET_PATH:Lokio/ByteString;
  34. const-string v0, ":scheme"
  35. invoke-static {v0}, Lokio/ByteString;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
  36. move-result-object v0
  37. sput-object v0, Lokhttp3/internal/http2/Header;->TARGET_SCHEME:Lokio/ByteString;
  38. const-string v0, ":authority"
  39. invoke-static {v0}, Lokio/ByteString;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
  40. move-result-object v0
  41. sput-object v0, Lokhttp3/internal/http2/Header;->TARGET_AUTHORITY:Lokio/ByteString;
  42. return-void
  43. .end method
  44. .method public constructor <init>(Ljava/lang/String;Ljava/lang/String;)V
  45. .locals 0
  46. invoke-static {p1}, Lokio/ByteString;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
  47. move-result-object p1
  48. invoke-static {p2}, Lokio/ByteString;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
  49. move-result-object p2
  50. invoke-direct {p0, p1, p2}, Lokhttp3/internal/http2/Header;-><init>(Lokio/ByteString;Lokio/ByteString;)V
  51. return-void
  52. .end method
  53. .method public constructor <init>(Lokio/ByteString;Ljava/lang/String;)V
  54. .locals 0
  55. invoke-static {p2}, Lokio/ByteString;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
  56. move-result-object p2
  57. invoke-direct {p0, p1, p2}, Lokhttp3/internal/http2/Header;-><init>(Lokio/ByteString;Lokio/ByteString;)V
  58. return-void
  59. .end method
  60. .method public constructor <init>(Lokio/ByteString;Lokio/ByteString;)V
  61. .locals 0
  62. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  63. iput-object p1, p0, Lokhttp3/internal/http2/Header;->name:Lokio/ByteString;
  64. iput-object p2, p0, Lokhttp3/internal/http2/Header;->value:Lokio/ByteString;
  65. invoke-virtual {p1}, Lokio/ByteString;->size()I
  66. move-result p1
  67. add-int/lit8 p1, p1, 0x20
  68. invoke-virtual {p2}, Lokio/ByteString;->size()I
  69. move-result p2
  70. add-int/2addr p1, p2
  71. iput p1, p0, Lokhttp3/internal/http2/Header;->hpackSize:I
  72. return-void
  73. .end method
  74. # virtual methods
  75. .method public equals(Ljava/lang/Object;)Z
  76. .locals 3
  77. instance-of v0, p1, Lokhttp3/internal/http2/Header;
  78. const/4 v1, 0x0
  79. if-eqz v0, :cond_0
  80. check-cast p1, Lokhttp3/internal/http2/Header;
  81. iget-object v0, p0, Lokhttp3/internal/http2/Header;->name:Lokio/ByteString;
  82. iget-object v2, p1, Lokhttp3/internal/http2/Header;->name:Lokio/ByteString;
  83. invoke-virtual {v0, v2}, Lokio/ByteString;->equals(Ljava/lang/Object;)Z
  84. move-result v0
  85. if-eqz v0, :cond_0
  86. iget-object v0, p0, Lokhttp3/internal/http2/Header;->value:Lokio/ByteString;
  87. iget-object p1, p1, Lokhttp3/internal/http2/Header;->value:Lokio/ByteString;
  88. invoke-virtual {v0, p1}, Lokio/ByteString;->equals(Ljava/lang/Object;)Z
  89. move-result p1
  90. if-eqz p1, :cond_0
  91. const/4 v1, 0x1
  92. :cond_0
  93. return v1
  94. .end method
  95. .method public hashCode()I
  96. .locals 2
  97. iget-object v0, p0, Lokhttp3/internal/http2/Header;->name:Lokio/ByteString;
  98. invoke-virtual {v0}, Lokio/ByteString;->hashCode()I
  99. move-result v0
  100. const/16 v1, 0x20f
  101. add-int/2addr v1, v0
  102. mul-int/lit8 v1, v1, 0x1f
  103. iget-object v0, p0, Lokhttp3/internal/http2/Header;->value:Lokio/ByteString;
  104. invoke-virtual {v0}, Lokio/ByteString;->hashCode()I
  105. move-result v0
  106. add-int/2addr v1, v0
  107. return v1
  108. .end method
  109. .method public toString()Ljava/lang/String;
  110. .locals 3
  111. const/4 v0, 0x2
  112. new-array v0, v0, [Ljava/lang/Object;
  113. iget-object v1, p0, Lokhttp3/internal/http2/Header;->name:Lokio/ByteString;
  114. invoke-virtual {v1}, Lokio/ByteString;->utf8()Ljava/lang/String;
  115. move-result-object v1
  116. const/4 v2, 0x0
  117. aput-object v1, v0, v2
  118. iget-object v1, p0, Lokhttp3/internal/http2/Header;->value:Lokio/ByteString;
  119. invoke-virtual {v1}, Lokio/ByteString;->utf8()Ljava/lang/String;
  120. move-result-object v1
  121. const/4 v2, 0x1
  122. aput-object v1, v0, v2
  123. const-string v1, "%s: %s"
  124. invoke-static {v1, v0}, Lokhttp3/internal/Util;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
  125. move-result-object v0
  126. return-object v0
  127. .end method