RealBufferedSource.smali 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214
  1. .class final Lokio/RealBufferedSource;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # interfaces
  5. .implements Lokio/BufferedSource;
  6. # instance fields
  7. .field public final buffer:Lokio/Buffer;
  8. .field closed:Z
  9. .field public final source:Lokio/Source;
  10. # direct methods
  11. .method constructor <init>(Lokio/Source;)V
  12. .locals 1
  13. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  14. new-instance v0, Lokio/Buffer;
  15. invoke-direct {v0}, Lokio/Buffer;-><init>()V
  16. iput-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  17. if-eqz p1, :cond_0
  18. iput-object p1, p0, Lokio/RealBufferedSource;->source:Lokio/Source;
  19. return-void
  20. :cond_0
  21. new-instance p1, Ljava/lang/NullPointerException;
  22. const-string v0, "source == null"
  23. invoke-direct {p1, v0}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
  24. throw p1
  25. .end method
  26. # virtual methods
  27. .method public buffer()Lokio/Buffer;
  28. .locals 1
  29. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  30. return-object v0
  31. .end method
  32. .method public close()V
  33. .locals 1
  34. .annotation system Ldalvik/annotation/Throws;
  35. value = {
  36. Ljava/io/IOException;
  37. }
  38. .end annotation
  39. iget-boolean v0, p0, Lokio/RealBufferedSource;->closed:Z
  40. if-eqz v0, :cond_0
  41. return-void
  42. :cond_0
  43. const/4 v0, 0x1
  44. iput-boolean v0, p0, Lokio/RealBufferedSource;->closed:Z
  45. iget-object v0, p0, Lokio/RealBufferedSource;->source:Lokio/Source;
  46. invoke-interface {v0}, Lokio/Source;->close()V
  47. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  48. invoke-virtual {v0}, Lokio/Buffer;->clear()V
  49. return-void
  50. .end method
  51. .method public exhausted()Z
  52. .locals 5
  53. .annotation system Ldalvik/annotation/Throws;
  54. value = {
  55. Ljava/io/IOException;
  56. }
  57. .end annotation
  58. iget-boolean v0, p0, Lokio/RealBufferedSource;->closed:Z
  59. if-nez v0, :cond_1
  60. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  61. invoke-virtual {v0}, Lokio/Buffer;->exhausted()Z
  62. move-result v0
  63. if-eqz v0, :cond_0
  64. iget-object v0, p0, Lokio/RealBufferedSource;->source:Lokio/Source;
  65. iget-object v1, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  66. const-wide/16 v2, 0x2000
  67. invoke-interface {v0, v1, v2, v3}, Lokio/Source;->read(Lokio/Buffer;J)J
  68. move-result-wide v0
  69. const-wide/16 v2, -0x1
  70. cmp-long v4, v0, v2
  71. if-nez v4, :cond_0
  72. const/4 v0, 0x1
  73. goto :goto_0
  74. :cond_0
  75. const/4 v0, 0x0
  76. :goto_0
  77. return v0
  78. :cond_1
  79. new-instance v0, Ljava/lang/IllegalStateException;
  80. const-string v1, "closed"
  81. invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  82. throw v0
  83. .end method
  84. .method public indexOf(B)J
  85. .locals 6
  86. .annotation system Ldalvik/annotation/Throws;
  87. value = {
  88. Ljava/io/IOException;
  89. }
  90. .end annotation
  91. const-wide/16 v2, 0x0
  92. const-wide v4, 0x7fffffffffffffffL
  93. move-object v0, p0
  94. move v1, p1
  95. invoke-virtual/range {v0 .. v5}, Lokio/RealBufferedSource;->indexOf(BJJ)J
  96. move-result-wide v0
  97. return-wide v0
  98. .end method
  99. .method public indexOf(BJ)J
  100. .locals 6
  101. .annotation system Ldalvik/annotation/Throws;
  102. value = {
  103. Ljava/io/IOException;
  104. }
  105. .end annotation
  106. const-wide v4, 0x7fffffffffffffffL
  107. move-object v0, p0
  108. move v1, p1
  109. move-wide v2, p2
  110. invoke-virtual/range {v0 .. v5}, Lokio/RealBufferedSource;->indexOf(BJJ)J
  111. move-result-wide p1
  112. return-wide p1
  113. .end method
  114. .method public indexOf(BJJ)J
  115. .locals 9
  116. .annotation system Ldalvik/annotation/Throws;
  117. value = {
  118. Ljava/io/IOException;
  119. }
  120. .end annotation
  121. iget-boolean v0, p0, Lokio/RealBufferedSource;->closed:Z
  122. if-nez v0, :cond_4
  123. const-wide/16 v0, 0x0
  124. cmp-long v2, p2, v0
  125. if-ltz v2, :cond_3
  126. cmp-long v0, p4, p2
  127. if-ltz v0, :cond_3
  128. :goto_0
  129. const-wide/16 v7, -0x1
  130. cmp-long v0, p2, p4
  131. if-gez v0, :cond_2
  132. iget-object v1, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  133. move v2, p1
  134. move-wide v3, p2
  135. move-wide v5, p4
  136. invoke-virtual/range {v1 .. v6}, Lokio/Buffer;->indexOf(BJJ)J
  137. move-result-wide v0
  138. cmp-long v2, v0, v7
  139. if-eqz v2, :cond_0
  140. return-wide v0
  141. :cond_0
  142. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  143. iget-wide v1, v0, Lokio/Buffer;->size:J
  144. cmp-long v3, v1, p4
  145. if-gez v3, :cond_2
  146. iget-object v3, p0, Lokio/RealBufferedSource;->source:Lokio/Source;
  147. const-wide/16 v4, 0x2000
  148. invoke-interface {v3, v0, v4, v5}, Lokio/Source;->read(Lokio/Buffer;J)J
  149. move-result-wide v3
  150. cmp-long v0, v3, v7
  151. if-nez v0, :cond_1
  152. goto :goto_1
  153. :cond_1
  154. invoke-static {p2, p3, v1, v2}, Ljava/lang/Math;->max(JJ)J
  155. move-result-wide p2
  156. goto :goto_0
  157. :cond_2
  158. :goto_1
  159. return-wide v7
  160. :cond_3
  161. new-instance p1, Ljava/lang/IllegalArgumentException;
  162. const/4 v0, 0x2
  163. new-array v0, v0, [Ljava/lang/Object;
  164. const/4 v1, 0x0
  165. invoke-static {p2, p3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
  166. move-result-object p2
  167. aput-object p2, v0, v1
  168. const/4 p2, 0x1
  169. invoke-static {p4, p5}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
  170. move-result-object p3
  171. aput-object p3, v0, p2
  172. const-string p2, "fromIndex=%s toIndex=%s"
  173. invoke-static {p2, v0}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
  174. move-result-object p2
  175. invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  176. throw p1
  177. :cond_4
  178. new-instance p1, Ljava/lang/IllegalStateException;
  179. const-string p2, "closed"
  180. invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  181. goto :goto_3
  182. :goto_2
  183. throw p1
  184. :goto_3
  185. goto :goto_2
  186. .end method
  187. .method public indexOf(Lokio/ByteString;)J
  188. .locals 2
  189. .annotation system Ldalvik/annotation/Throws;
  190. value = {
  191. Ljava/io/IOException;
  192. }
  193. .end annotation
  194. const-wide/16 v0, 0x0
  195. invoke-virtual {p0, p1, v0, v1}, Lokio/RealBufferedSource;->indexOf(Lokio/ByteString;J)J
  196. move-result-wide v0
  197. return-wide v0
  198. .end method
  199. .method public indexOf(Lokio/ByteString;J)J
  200. .locals 8
  201. .annotation system Ldalvik/annotation/Throws;
  202. value = {
  203. Ljava/io/IOException;
  204. }
  205. .end annotation
  206. iget-boolean v0, p0, Lokio/RealBufferedSource;->closed:Z
  207. if-nez v0, :cond_2
  208. :goto_0
  209. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  210. invoke-virtual {v0, p1, p2, p3}, Lokio/Buffer;->indexOf(Lokio/ByteString;J)J
  211. move-result-wide v0
  212. const-wide/16 v2, -0x1
  213. cmp-long v4, v0, v2
  214. if-eqz v4, :cond_0
  215. return-wide v0
  216. :cond_0
  217. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  218. iget-wide v4, v0, Lokio/Buffer;->size:J
  219. iget-object v1, p0, Lokio/RealBufferedSource;->source:Lokio/Source;
  220. const-wide/16 v6, 0x2000
  221. invoke-interface {v1, v0, v6, v7}, Lokio/Source;->read(Lokio/Buffer;J)J
  222. move-result-wide v0
  223. cmp-long v6, v0, v2
  224. if-nez v6, :cond_1
  225. return-wide v2
  226. :cond_1
  227. invoke-virtual {p1}, Lokio/ByteString;->size()I
  228. move-result v0
  229. int-to-long v0, v0
  230. sub-long/2addr v4, v0
  231. const-wide/16 v0, 0x1
  232. add-long/2addr v4, v0
  233. invoke-static {p2, p3, v4, v5}, Ljava/lang/Math;->max(JJ)J
  234. move-result-wide p2
  235. goto :goto_0
  236. :cond_2
  237. new-instance p1, Ljava/lang/IllegalStateException;
  238. const-string p2, "closed"
  239. invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  240. goto :goto_2
  241. :goto_1
  242. throw p1
  243. :goto_2
  244. goto :goto_1
  245. .end method
  246. .method public indexOfElement(Lokio/ByteString;)J
  247. .locals 2
  248. .annotation system Ldalvik/annotation/Throws;
  249. value = {
  250. Ljava/io/IOException;
  251. }
  252. .end annotation
  253. const-wide/16 v0, 0x0
  254. invoke-virtual {p0, p1, v0, v1}, Lokio/RealBufferedSource;->indexOfElement(Lokio/ByteString;J)J
  255. move-result-wide v0
  256. return-wide v0
  257. .end method
  258. .method public indexOfElement(Lokio/ByteString;J)J
  259. .locals 8
  260. .annotation system Ldalvik/annotation/Throws;
  261. value = {
  262. Ljava/io/IOException;
  263. }
  264. .end annotation
  265. iget-boolean v0, p0, Lokio/RealBufferedSource;->closed:Z
  266. if-nez v0, :cond_2
  267. :goto_0
  268. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  269. invoke-virtual {v0, p1, p2, p3}, Lokio/Buffer;->indexOfElement(Lokio/ByteString;J)J
  270. move-result-wide v0
  271. const-wide/16 v2, -0x1
  272. cmp-long v4, v0, v2
  273. if-eqz v4, :cond_0
  274. return-wide v0
  275. :cond_0
  276. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  277. iget-wide v4, v0, Lokio/Buffer;->size:J
  278. iget-object v1, p0, Lokio/RealBufferedSource;->source:Lokio/Source;
  279. const-wide/16 v6, 0x2000
  280. invoke-interface {v1, v0, v6, v7}, Lokio/Source;->read(Lokio/Buffer;J)J
  281. move-result-wide v0
  282. cmp-long v6, v0, v2
  283. if-nez v6, :cond_1
  284. return-wide v2
  285. :cond_1
  286. invoke-static {p2, p3, v4, v5}, Ljava/lang/Math;->max(JJ)J
  287. move-result-wide p2
  288. goto :goto_0
  289. :cond_2
  290. new-instance p1, Ljava/lang/IllegalStateException;
  291. const-string p2, "closed"
  292. invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  293. goto :goto_2
  294. :goto_1
  295. throw p1
  296. :goto_2
  297. goto :goto_1
  298. .end method
  299. .method public inputStream()Ljava/io/InputStream;
  300. .locals 1
  301. new-instance v0, Lokio/RealBufferedSource$1;
  302. invoke-direct {v0, p0}, Lokio/RealBufferedSource$1;-><init>(Lokio/RealBufferedSource;)V
  303. return-object v0
  304. .end method
  305. .method public rangeEquals(JLokio/ByteString;)Z
  306. .locals 6
  307. .annotation system Ldalvik/annotation/Throws;
  308. value = {
  309. Ljava/io/IOException;
  310. }
  311. .end annotation
  312. invoke-virtual {p3}, Lokio/ByteString;->size()I
  313. move-result v5
  314. const/4 v4, 0x0
  315. move-object v0, p0
  316. move-wide v1, p1
  317. move-object v3, p3
  318. invoke-virtual/range {v0 .. v5}, Lokio/RealBufferedSource;->rangeEquals(JLokio/ByteString;II)Z
  319. move-result p1
  320. return p1
  321. .end method
  322. .method public rangeEquals(JLokio/ByteString;II)Z
  323. .locals 7
  324. .annotation system Ldalvik/annotation/Throws;
  325. value = {
  326. Ljava/io/IOException;
  327. }
  328. .end annotation
  329. iget-boolean v0, p0, Lokio/RealBufferedSource;->closed:Z
  330. if-nez v0, :cond_5
  331. const-wide/16 v0, 0x0
  332. const/4 v2, 0x0
  333. cmp-long v3, p1, v0
  334. if-ltz v3, :cond_4
  335. if-ltz p4, :cond_4
  336. if-ltz p5, :cond_4
  337. invoke-virtual {p3}, Lokio/ByteString;->size()I
  338. move-result v0
  339. sub-int/2addr v0, p4
  340. if-ge v0, p5, :cond_0
  341. goto :goto_1
  342. :cond_0
  343. const/4 v0, 0x0
  344. :goto_0
  345. if-ge v0, p5, :cond_3
  346. int-to-long v3, v0
  347. add-long/2addr v3, p1
  348. const-wide/16 v5, 0x1
  349. add-long/2addr v5, v3
  350. invoke-virtual {p0, v5, v6}, Lokio/RealBufferedSource;->request(J)Z
  351. move-result v1
  352. if-nez v1, :cond_1
  353. return v2
  354. :cond_1
  355. iget-object v1, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  356. invoke-virtual {v1, v3, v4}, Lokio/Buffer;->getByte(J)B
  357. move-result v1
  358. add-int v3, p4, v0
  359. invoke-virtual {p3, v3}, Lokio/ByteString;->getByte(I)B
  360. move-result v3
  361. if-eq v1, v3, :cond_2
  362. return v2
  363. :cond_2
  364. add-int/lit8 v0, v0, 0x1
  365. goto :goto_0
  366. :cond_3
  367. const/4 p1, 0x1
  368. return p1
  369. :cond_4
  370. :goto_1
  371. return v2
  372. :cond_5
  373. new-instance p1, Ljava/lang/IllegalStateException;
  374. const-string p2, "closed"
  375. invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  376. goto :goto_3
  377. :goto_2
  378. throw p1
  379. :goto_3
  380. goto :goto_2
  381. .end method
  382. .method public read([B)I
  383. .locals 2
  384. .annotation system Ldalvik/annotation/Throws;
  385. value = {
  386. Ljava/io/IOException;
  387. }
  388. .end annotation
  389. array-length v0, p1
  390. const/4 v1, 0x0
  391. invoke-virtual {p0, p1, v1, v0}, Lokio/RealBufferedSource;->read([BII)I
  392. move-result p1
  393. return p1
  394. .end method
  395. .method public read([BII)I
  396. .locals 9
  397. .annotation system Ldalvik/annotation/Throws;
  398. value = {
  399. Ljava/io/IOException;
  400. }
  401. .end annotation
  402. array-length v0, p1
  403. int-to-long v1, v0
  404. int-to-long v3, p2
  405. int-to-long v7, p3
  406. move-wide v5, v7
  407. invoke-static/range {v1 .. v6}, Lokio/Util;->checkOffsetAndCount(JJJ)V
  408. iget-object p3, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  409. iget-wide v0, p3, Lokio/Buffer;->size:J
  410. const-wide/16 v2, 0x0
  411. cmp-long v4, v0, v2
  412. if-nez v4, :cond_0
  413. iget-object v0, p0, Lokio/RealBufferedSource;->source:Lokio/Source;
  414. const-wide/16 v1, 0x2000
  415. invoke-interface {v0, p3, v1, v2}, Lokio/Source;->read(Lokio/Buffer;J)J
  416. move-result-wide v0
  417. const-wide/16 v2, -0x1
  418. cmp-long p3, v0, v2
  419. if-nez p3, :cond_0
  420. const/4 p1, -0x1
  421. return p1
  422. :cond_0
  423. iget-object p3, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  424. iget-wide v0, p3, Lokio/Buffer;->size:J
  425. invoke-static {v7, v8, v0, v1}, Ljava/lang/Math;->min(JJ)J
  426. move-result-wide v0
  427. long-to-int p3, v0
  428. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  429. invoke-virtual {v0, p1, p2, p3}, Lokio/Buffer;->read([BII)I
  430. move-result p1
  431. return p1
  432. .end method
  433. .method public read(Lokio/Buffer;J)J
  434. .locals 6
  435. .annotation system Ldalvik/annotation/Throws;
  436. value = {
  437. Ljava/io/IOException;
  438. }
  439. .end annotation
  440. if-eqz p1, :cond_3
  441. const-wide/16 v0, 0x0
  442. cmp-long v2, p2, v0
  443. if-ltz v2, :cond_2
  444. iget-boolean v2, p0, Lokio/RealBufferedSource;->closed:Z
  445. if-nez v2, :cond_1
  446. iget-object v2, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  447. iget-wide v3, v2, Lokio/Buffer;->size:J
  448. cmp-long v5, v3, v0
  449. if-nez v5, :cond_0
  450. iget-object v0, p0, Lokio/RealBufferedSource;->source:Lokio/Source;
  451. const-wide/16 v3, 0x2000
  452. invoke-interface {v0, v2, v3, v4}, Lokio/Source;->read(Lokio/Buffer;J)J
  453. move-result-wide v0
  454. const-wide/16 v2, -0x1
  455. cmp-long v4, v0, v2
  456. if-nez v4, :cond_0
  457. return-wide v2
  458. :cond_0
  459. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  460. iget-wide v0, v0, Lokio/Buffer;->size:J
  461. invoke-static {p2, p3, v0, v1}, Ljava/lang/Math;->min(JJ)J
  462. move-result-wide p2
  463. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  464. invoke-virtual {v0, p1, p2, p3}, Lokio/Buffer;->read(Lokio/Buffer;J)J
  465. move-result-wide p1
  466. return-wide p1
  467. :cond_1
  468. new-instance p1, Ljava/lang/IllegalStateException;
  469. const-string p2, "closed"
  470. invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  471. throw p1
  472. :cond_2
  473. new-instance p1, Ljava/lang/IllegalArgumentException;
  474. new-instance v0, Ljava/lang/StringBuilder;
  475. invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
  476. const-string v1, "byteCount < 0: "
  477. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  478. invoke-virtual {v0, p2, p3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
  479. invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  480. move-result-object p2
  481. invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  482. throw p1
  483. :cond_3
  484. new-instance p1, Ljava/lang/IllegalArgumentException;
  485. const-string p2, "sink == null"
  486. invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  487. throw p1
  488. .end method
  489. .method public readAll(Lokio/Sink;)J
  490. .locals 9
  491. .annotation system Ldalvik/annotation/Throws;
  492. value = {
  493. Ljava/io/IOException;
  494. }
  495. .end annotation
  496. if-eqz p1, :cond_3
  497. const-wide/16 v0, 0x0
  498. move-wide v2, v0
  499. :cond_0
  500. :goto_0
  501. iget-object v4, p0, Lokio/RealBufferedSource;->source:Lokio/Source;
  502. iget-object v5, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  503. const-wide/16 v6, 0x2000
  504. invoke-interface {v4, v5, v6, v7}, Lokio/Source;->read(Lokio/Buffer;J)J
  505. move-result-wide v4
  506. const-wide/16 v6, -0x1
  507. cmp-long v8, v4, v6
  508. iget-object v4, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  509. if-eqz v8, :cond_1
  510. invoke-virtual {v4}, Lokio/Buffer;->completeSegmentByteCount()J
  511. move-result-wide v4
  512. cmp-long v6, v4, v0
  513. if-lez v6, :cond_0
  514. add-long/2addr v2, v4
  515. iget-object v6, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  516. invoke-interface {p1, v6, v4, v5}, Lokio/Sink;->write(Lokio/Buffer;J)V
  517. goto :goto_0
  518. :cond_1
  519. invoke-virtual {v4}, Lokio/Buffer;->size()J
  520. move-result-wide v4
  521. cmp-long v6, v4, v0
  522. if-lez v6, :cond_2
  523. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  524. invoke-virtual {v0}, Lokio/Buffer;->size()J
  525. move-result-wide v0
  526. add-long/2addr v2, v0
  527. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  528. invoke-virtual {v0}, Lokio/Buffer;->size()J
  529. move-result-wide v4
  530. invoke-interface {p1, v0, v4, v5}, Lokio/Sink;->write(Lokio/Buffer;J)V
  531. :cond_2
  532. return-wide v2
  533. :cond_3
  534. new-instance p1, Ljava/lang/IllegalArgumentException;
  535. const-string v0, "sink == null"
  536. invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  537. goto :goto_2
  538. :goto_1
  539. throw p1
  540. :goto_2
  541. goto :goto_1
  542. .end method
  543. .method public readByte()B
  544. .locals 2
  545. .annotation system Ldalvik/annotation/Throws;
  546. value = {
  547. Ljava/io/IOException;
  548. }
  549. .end annotation
  550. const-wide/16 v0, 0x1
  551. invoke-virtual {p0, v0, v1}, Lokio/RealBufferedSource;->require(J)V
  552. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  553. invoke-virtual {v0}, Lokio/Buffer;->readByte()B
  554. move-result v0
  555. return v0
  556. .end method
  557. .method public readByteArray()[B
  558. .locals 2
  559. .annotation system Ldalvik/annotation/Throws;
  560. value = {
  561. Ljava/io/IOException;
  562. }
  563. .end annotation
  564. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  565. iget-object v1, p0, Lokio/RealBufferedSource;->source:Lokio/Source;
  566. invoke-virtual {v0, v1}, Lokio/Buffer;->writeAll(Lokio/Source;)J
  567. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  568. invoke-virtual {v0}, Lokio/Buffer;->readByteArray()[B
  569. move-result-object v0
  570. return-object v0
  571. .end method
  572. .method public readByteArray(J)[B
  573. .locals 1
  574. .annotation system Ldalvik/annotation/Throws;
  575. value = {
  576. Ljava/io/IOException;
  577. }
  578. .end annotation
  579. invoke-virtual {p0, p1, p2}, Lokio/RealBufferedSource;->require(J)V
  580. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  581. invoke-virtual {v0, p1, p2}, Lokio/Buffer;->readByteArray(J)[B
  582. move-result-object p1
  583. return-object p1
  584. .end method
  585. .method public readByteString()Lokio/ByteString;
  586. .locals 2
  587. .annotation system Ldalvik/annotation/Throws;
  588. value = {
  589. Ljava/io/IOException;
  590. }
  591. .end annotation
  592. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  593. iget-object v1, p0, Lokio/RealBufferedSource;->source:Lokio/Source;
  594. invoke-virtual {v0, v1}, Lokio/Buffer;->writeAll(Lokio/Source;)J
  595. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  596. invoke-virtual {v0}, Lokio/Buffer;->readByteString()Lokio/ByteString;
  597. move-result-object v0
  598. return-object v0
  599. .end method
  600. .method public readByteString(J)Lokio/ByteString;
  601. .locals 1
  602. .annotation system Ldalvik/annotation/Throws;
  603. value = {
  604. Ljava/io/IOException;
  605. }
  606. .end annotation
  607. invoke-virtual {p0, p1, p2}, Lokio/RealBufferedSource;->require(J)V
  608. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  609. invoke-virtual {v0, p1, p2}, Lokio/Buffer;->readByteString(J)Lokio/ByteString;
  610. move-result-object p1
  611. return-object p1
  612. .end method
  613. .method public readDecimalLong()J
  614. .locals 6
  615. .annotation system Ldalvik/annotation/Throws;
  616. value = {
  617. Ljava/io/IOException;
  618. }
  619. .end annotation
  620. const-wide/16 v0, 0x1
  621. invoke-virtual {p0, v0, v1}, Lokio/RealBufferedSource;->require(J)V
  622. const/4 v0, 0x0
  623. const/4 v1, 0x0
  624. :goto_0
  625. add-int/lit8 v2, v1, 0x1
  626. int-to-long v3, v2
  627. invoke-virtual {p0, v3, v4}, Lokio/RealBufferedSource;->request(J)Z
  628. move-result v3
  629. if-eqz v3, :cond_4
  630. iget-object v3, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  631. int-to-long v4, v1
  632. invoke-virtual {v3, v4, v5}, Lokio/Buffer;->getByte(J)B
  633. move-result v3
  634. const/16 v4, 0x30
  635. if-lt v3, v4, :cond_0
  636. const/16 v4, 0x39
  637. if-le v3, v4, :cond_1
  638. :cond_0
  639. if-nez v1, :cond_2
  640. const/16 v4, 0x2d
  641. if-eq v3, v4, :cond_1
  642. goto :goto_1
  643. :cond_1
  644. move v1, v2
  645. goto :goto_0
  646. :cond_2
  647. :goto_1
  648. if-eqz v1, :cond_3
  649. goto :goto_2
  650. :cond_3
  651. new-instance v1, Ljava/lang/NumberFormatException;
  652. const/4 v2, 0x1
  653. new-array v2, v2, [Ljava/lang/Object;
  654. invoke-static {v3}, Ljava/lang/Byte;->valueOf(B)Ljava/lang/Byte;
  655. move-result-object v3
  656. aput-object v3, v2, v0
  657. const-string v0, "Expected leading [0-9] or \'-\' character but was %#x"
  658. invoke-static {v0, v2}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
  659. move-result-object v0
  660. invoke-direct {v1, v0}, Ljava/lang/NumberFormatException;-><init>(Ljava/lang/String;)V
  661. throw v1
  662. :cond_4
  663. :goto_2
  664. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  665. invoke-virtual {v0}, Lokio/Buffer;->readDecimalLong()J
  666. move-result-wide v0
  667. return-wide v0
  668. .end method
  669. .method public readFully(Lokio/Buffer;J)V
  670. .locals 1
  671. .annotation system Ldalvik/annotation/Throws;
  672. value = {
  673. Ljava/io/IOException;
  674. }
  675. .end annotation
  676. :try_start_0
  677. invoke-virtual {p0, p2, p3}, Lokio/RealBufferedSource;->require(J)V
  678. :try_end_0
  679. .catch Ljava/io/EOFException; {:try_start_0 .. :try_end_0} :catch_0
  680. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  681. invoke-virtual {v0, p1, p2, p3}, Lokio/Buffer;->readFully(Lokio/Buffer;J)V
  682. return-void
  683. :catch_0
  684. move-exception p2
  685. iget-object p3, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  686. invoke-virtual {p1, p3}, Lokio/Buffer;->writeAll(Lokio/Source;)J
  687. throw p2
  688. .end method
  689. .method public readFully([B)V
  690. .locals 8
  691. .annotation system Ldalvik/annotation/Throws;
  692. value = {
  693. Ljava/io/IOException;
  694. }
  695. .end annotation
  696. :try_start_0
  697. array-length v0, p1
  698. int-to-long v0, v0
  699. invoke-virtual {p0, v0, v1}, Lokio/RealBufferedSource;->require(J)V
  700. :try_end_0
  701. .catch Ljava/io/EOFException; {:try_start_0 .. :try_end_0} :catch_0
  702. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  703. invoke-virtual {v0, p1}, Lokio/Buffer;->readFully([B)V
  704. return-void
  705. :catch_0
  706. move-exception v0
  707. const/4 v1, 0x0
  708. :goto_0
  709. iget-object v2, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  710. iget-wide v3, v2, Lokio/Buffer;->size:J
  711. const-wide/16 v5, 0x0
  712. cmp-long v7, v3, v5
  713. if-lez v7, :cond_1
  714. long-to-int v4, v3
  715. invoke-virtual {v2, p1, v1, v4}, Lokio/Buffer;->read([BII)I
  716. move-result v2
  717. const/4 v3, -0x1
  718. if-eq v2, v3, :cond_0
  719. add-int/2addr v1, v2
  720. goto :goto_0
  721. :cond_0
  722. new-instance p1, Ljava/lang/AssertionError;
  723. invoke-direct {p1}, Ljava/lang/AssertionError;-><init>()V
  724. throw p1
  725. :cond_1
  726. goto :goto_2
  727. :goto_1
  728. throw v0
  729. :goto_2
  730. goto :goto_1
  731. .end method
  732. .method public readHexadecimalUnsignedLong()J
  733. .locals 6
  734. .annotation system Ldalvik/annotation/Throws;
  735. value = {
  736. Ljava/io/IOException;
  737. }
  738. .end annotation
  739. const-wide/16 v0, 0x1
  740. invoke-virtual {p0, v0, v1}, Lokio/RealBufferedSource;->require(J)V
  741. const/4 v0, 0x0
  742. const/4 v1, 0x0
  743. :goto_0
  744. add-int/lit8 v2, v1, 0x1
  745. int-to-long v3, v2
  746. invoke-virtual {p0, v3, v4}, Lokio/RealBufferedSource;->request(J)Z
  747. move-result v3
  748. if-eqz v3, :cond_5
  749. iget-object v3, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  750. int-to-long v4, v1
  751. invoke-virtual {v3, v4, v5}, Lokio/Buffer;->getByte(J)B
  752. move-result v3
  753. const/16 v4, 0x30
  754. if-lt v3, v4, :cond_0
  755. const/16 v4, 0x39
  756. if-le v3, v4, :cond_2
  757. :cond_0
  758. const/16 v4, 0x61
  759. if-lt v3, v4, :cond_1
  760. const/16 v4, 0x66
  761. if-le v3, v4, :cond_2
  762. :cond_1
  763. const/16 v4, 0x41
  764. if-lt v3, v4, :cond_3
  765. const/16 v4, 0x46
  766. if-le v3, v4, :cond_2
  767. goto :goto_1
  768. :cond_2
  769. move v1, v2
  770. goto :goto_0
  771. :cond_3
  772. :goto_1
  773. if-eqz v1, :cond_4
  774. goto :goto_2
  775. :cond_4
  776. new-instance v1, Ljava/lang/NumberFormatException;
  777. const/4 v2, 0x1
  778. new-array v2, v2, [Ljava/lang/Object;
  779. invoke-static {v3}, Ljava/lang/Byte;->valueOf(B)Ljava/lang/Byte;
  780. move-result-object v3
  781. aput-object v3, v2, v0
  782. const-string v0, "Expected leading [0-9a-fA-F] character but was %#x"
  783. invoke-static {v0, v2}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
  784. move-result-object v0
  785. invoke-direct {v1, v0}, Ljava/lang/NumberFormatException;-><init>(Ljava/lang/String;)V
  786. throw v1
  787. :cond_5
  788. :goto_2
  789. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  790. invoke-virtual {v0}, Lokio/Buffer;->readHexadecimalUnsignedLong()J
  791. move-result-wide v0
  792. return-wide v0
  793. .end method
  794. .method public readInt()I
  795. .locals 2
  796. .annotation system Ldalvik/annotation/Throws;
  797. value = {
  798. Ljava/io/IOException;
  799. }
  800. .end annotation
  801. const-wide/16 v0, 0x4
  802. invoke-virtual {p0, v0, v1}, Lokio/RealBufferedSource;->require(J)V
  803. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  804. invoke-virtual {v0}, Lokio/Buffer;->readInt()I
  805. move-result v0
  806. return v0
  807. .end method
  808. .method public readIntLe()I
  809. .locals 2
  810. .annotation system Ldalvik/annotation/Throws;
  811. value = {
  812. Ljava/io/IOException;
  813. }
  814. .end annotation
  815. const-wide/16 v0, 0x4
  816. invoke-virtual {p0, v0, v1}, Lokio/RealBufferedSource;->require(J)V
  817. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  818. invoke-virtual {v0}, Lokio/Buffer;->readIntLe()I
  819. move-result v0
  820. return v0
  821. .end method
  822. .method public readLong()J
  823. .locals 2
  824. .annotation system Ldalvik/annotation/Throws;
  825. value = {
  826. Ljava/io/IOException;
  827. }
  828. .end annotation
  829. const-wide/16 v0, 0x8
  830. invoke-virtual {p0, v0, v1}, Lokio/RealBufferedSource;->require(J)V
  831. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  832. invoke-virtual {v0}, Lokio/Buffer;->readLong()J
  833. move-result-wide v0
  834. return-wide v0
  835. .end method
  836. .method public readLongLe()J
  837. .locals 2
  838. .annotation system Ldalvik/annotation/Throws;
  839. value = {
  840. Ljava/io/IOException;
  841. }
  842. .end annotation
  843. const-wide/16 v0, 0x8
  844. invoke-virtual {p0, v0, v1}, Lokio/RealBufferedSource;->require(J)V
  845. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  846. invoke-virtual {v0}, Lokio/Buffer;->readLongLe()J
  847. move-result-wide v0
  848. return-wide v0
  849. .end method
  850. .method public readShort()S
  851. .locals 2
  852. .annotation system Ldalvik/annotation/Throws;
  853. value = {
  854. Ljava/io/IOException;
  855. }
  856. .end annotation
  857. const-wide/16 v0, 0x2
  858. invoke-virtual {p0, v0, v1}, Lokio/RealBufferedSource;->require(J)V
  859. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  860. invoke-virtual {v0}, Lokio/Buffer;->readShort()S
  861. move-result v0
  862. return v0
  863. .end method
  864. .method public readShortLe()S
  865. .locals 2
  866. .annotation system Ldalvik/annotation/Throws;
  867. value = {
  868. Ljava/io/IOException;
  869. }
  870. .end annotation
  871. const-wide/16 v0, 0x2
  872. invoke-virtual {p0, v0, v1}, Lokio/RealBufferedSource;->require(J)V
  873. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  874. invoke-virtual {v0}, Lokio/Buffer;->readShortLe()S
  875. move-result v0
  876. return v0
  877. .end method
  878. .method public readString(JLjava/nio/charset/Charset;)Ljava/lang/String;
  879. .locals 1
  880. .annotation system Ldalvik/annotation/Throws;
  881. value = {
  882. Ljava/io/IOException;
  883. }
  884. .end annotation
  885. invoke-virtual {p0, p1, p2}, Lokio/RealBufferedSource;->require(J)V
  886. if-eqz p3, :cond_0
  887. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  888. invoke-virtual {v0, p1, p2, p3}, Lokio/Buffer;->readString(JLjava/nio/charset/Charset;)Ljava/lang/String;
  889. move-result-object p1
  890. return-object p1
  891. :cond_0
  892. new-instance p1, Ljava/lang/IllegalArgumentException;
  893. const-string p2, "charset == null"
  894. invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  895. throw p1
  896. .end method
  897. .method public readString(Ljava/nio/charset/Charset;)Ljava/lang/String;
  898. .locals 2
  899. .annotation system Ldalvik/annotation/Throws;
  900. value = {
  901. Ljava/io/IOException;
  902. }
  903. .end annotation
  904. if-eqz p1, :cond_0
  905. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  906. iget-object v1, p0, Lokio/RealBufferedSource;->source:Lokio/Source;
  907. invoke-virtual {v0, v1}, Lokio/Buffer;->writeAll(Lokio/Source;)J
  908. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  909. invoke-virtual {v0, p1}, Lokio/Buffer;->readString(Ljava/nio/charset/Charset;)Ljava/lang/String;
  910. move-result-object p1
  911. return-object p1
  912. :cond_0
  913. new-instance p1, Ljava/lang/IllegalArgumentException;
  914. const-string v0, "charset == null"
  915. invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  916. throw p1
  917. .end method
  918. .method public readUtf8()Ljava/lang/String;
  919. .locals 2
  920. .annotation system Ldalvik/annotation/Throws;
  921. value = {
  922. Ljava/io/IOException;
  923. }
  924. .end annotation
  925. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  926. iget-object v1, p0, Lokio/RealBufferedSource;->source:Lokio/Source;
  927. invoke-virtual {v0, v1}, Lokio/Buffer;->writeAll(Lokio/Source;)J
  928. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  929. invoke-virtual {v0}, Lokio/Buffer;->readUtf8()Ljava/lang/String;
  930. move-result-object v0
  931. return-object v0
  932. .end method
  933. .method public readUtf8(J)Ljava/lang/String;
  934. .locals 1
  935. .annotation system Ldalvik/annotation/Throws;
  936. value = {
  937. Ljava/io/IOException;
  938. }
  939. .end annotation
  940. invoke-virtual {p0, p1, p2}, Lokio/RealBufferedSource;->require(J)V
  941. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  942. invoke-virtual {v0, p1, p2}, Lokio/Buffer;->readUtf8(J)Ljava/lang/String;
  943. move-result-object p1
  944. return-object p1
  945. .end method
  946. .method public readUtf8CodePoint()I
  947. .locals 3
  948. .annotation system Ldalvik/annotation/Throws;
  949. value = {
  950. Ljava/io/IOException;
  951. }
  952. .end annotation
  953. const-wide/16 v0, 0x1
  954. invoke-virtual {p0, v0, v1}, Lokio/RealBufferedSource;->require(J)V
  955. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  956. const-wide/16 v1, 0x0
  957. invoke-virtual {v0, v1, v2}, Lokio/Buffer;->getByte(J)B
  958. move-result v0
  959. and-int/lit16 v1, v0, 0xe0
  960. const/16 v2, 0xc0
  961. if-ne v1, v2, :cond_0
  962. const-wide/16 v0, 0x2
  963. :goto_0
  964. invoke-virtual {p0, v0, v1}, Lokio/RealBufferedSource;->require(J)V
  965. goto :goto_1
  966. :cond_0
  967. and-int/lit16 v1, v0, 0xf0
  968. const/16 v2, 0xe0
  969. if-ne v1, v2, :cond_1
  970. const-wide/16 v0, 0x3
  971. goto :goto_0
  972. :cond_1
  973. and-int/lit16 v0, v0, 0xf8
  974. const/16 v1, 0xf0
  975. if-ne v0, v1, :cond_2
  976. const-wide/16 v0, 0x4
  977. goto :goto_0
  978. :cond_2
  979. :goto_1
  980. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  981. invoke-virtual {v0}, Lokio/Buffer;->readUtf8CodePoint()I
  982. move-result v0
  983. return v0
  984. .end method
  985. .method public readUtf8Line()Ljava/lang/String;
  986. .locals 5
  987. .annotation system Ldalvik/annotation/Throws;
  988. value = {
  989. Ljava/io/IOException;
  990. }
  991. .end annotation
  992. const/16 v0, 0xa
  993. invoke-virtual {p0, v0}, Lokio/RealBufferedSource;->indexOf(B)J
  994. move-result-wide v0
  995. const-wide/16 v2, -0x1
  996. cmp-long v4, v0, v2
  997. if-nez v4, :cond_1
  998. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  999. iget-wide v0, v0, Lokio/Buffer;->size:J
  1000. const-wide/16 v2, 0x0
  1001. cmp-long v4, v0, v2
  1002. if-eqz v4, :cond_0
  1003. invoke-virtual {p0, v0, v1}, Lokio/RealBufferedSource;->readUtf8(J)Ljava/lang/String;
  1004. move-result-object v0
  1005. goto :goto_0
  1006. :cond_0
  1007. const/4 v0, 0x0
  1008. :goto_0
  1009. return-object v0
  1010. :cond_1
  1011. iget-object v2, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  1012. invoke-virtual {v2, v0, v1}, Lokio/Buffer;->readUtf8Line(J)Ljava/lang/String;
  1013. move-result-object v0
  1014. return-object v0
  1015. .end method
  1016. .method public readUtf8LineStrict()Ljava/lang/String;
  1017. .locals 2
  1018. .annotation system Ldalvik/annotation/Throws;
  1019. value = {
  1020. Ljava/io/IOException;
  1021. }
  1022. .end annotation
  1023. const-wide v0, 0x7fffffffffffffffL
  1024. invoke-virtual {p0, v0, v1}, Lokio/RealBufferedSource;->readUtf8LineStrict(J)Ljava/lang/String;
  1025. move-result-object v0
  1026. return-object v0
  1027. .end method
  1028. .method public readUtf8LineStrict(J)Ljava/lang/String;
  1029. .locals 12
  1030. .annotation system Ldalvik/annotation/Throws;
  1031. value = {
  1032. Ljava/io/IOException;
  1033. }
  1034. .end annotation
  1035. const-wide/16 v0, 0x0
  1036. cmp-long v2, p1, v0
  1037. if-ltz v2, :cond_3
  1038. const-wide/16 v0, 0x1
  1039. const-wide v2, 0x7fffffffffffffffL
  1040. cmp-long v4, p1, v2
  1041. if-nez v4, :cond_0
  1042. move-wide v4, v2
  1043. goto :goto_0
  1044. :cond_0
  1045. add-long v4, p1, v0
  1046. :goto_0
  1047. const/16 v7, 0xa
  1048. const-wide/16 v8, 0x0
  1049. move-object v6, p0
  1050. move-wide v10, v4
  1051. invoke-virtual/range {v6 .. v11}, Lokio/RealBufferedSource;->indexOf(BJJ)J
  1052. move-result-wide v6
  1053. const-wide/16 v8, -0x1
  1054. cmp-long v10, v6, v8
  1055. if-eqz v10, :cond_1
  1056. iget-object p1, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  1057. invoke-virtual {p1, v6, v7}, Lokio/Buffer;->readUtf8Line(J)Ljava/lang/String;
  1058. move-result-object p1
  1059. return-object p1
  1060. :cond_1
  1061. cmp-long v6, v4, v2
  1062. if-gez v6, :cond_2
  1063. invoke-virtual {p0, v4, v5}, Lokio/RealBufferedSource;->request(J)Z
  1064. move-result v2
  1065. if-eqz v2, :cond_2
  1066. iget-object v2, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  1067. sub-long v6, v4, v0
  1068. invoke-virtual {v2, v6, v7}, Lokio/Buffer;->getByte(J)B
  1069. move-result v2
  1070. const/16 v3, 0xd
  1071. if-ne v2, v3, :cond_2
  1072. add-long/2addr v0, v4
  1073. invoke-virtual {p0, v0, v1}, Lokio/RealBufferedSource;->request(J)Z
  1074. move-result v0
  1075. if-eqz v0, :cond_2
  1076. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  1077. invoke-virtual {v0, v4, v5}, Lokio/Buffer;->getByte(J)B
  1078. move-result v0
  1079. const/16 v1, 0xa
  1080. if-ne v0, v1, :cond_2
  1081. iget-object p1, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  1082. invoke-virtual {p1, v4, v5}, Lokio/Buffer;->readUtf8Line(J)Ljava/lang/String;
  1083. move-result-object p1
  1084. return-object p1
  1085. :cond_2
  1086. new-instance v6, Lokio/Buffer;
  1087. invoke-direct {v6}, Lokio/Buffer;-><init>()V
  1088. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  1089. const-wide/16 v2, 0x0
  1090. const-wide/16 v4, 0x20
  1091. invoke-virtual {v0}, Lokio/Buffer;->size()J
  1092. move-result-wide v7
  1093. invoke-static {v4, v5, v7, v8}, Ljava/lang/Math;->min(JJ)J
  1094. move-result-wide v4
  1095. move-object v1, v6
  1096. invoke-virtual/range {v0 .. v5}, Lokio/Buffer;->copyTo(Lokio/Buffer;JJ)Lokio/Buffer;
  1097. new-instance v0, Ljava/io/EOFException;
  1098. new-instance v1, Ljava/lang/StringBuilder;
  1099. invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
  1100. const-string v2, "\\n not found: limit="
  1101. invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  1102. iget-object v2, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  1103. invoke-virtual {v2}, Lokio/Buffer;->size()J
  1104. move-result-wide v2
  1105. invoke-static {v2, v3, p1, p2}, Ljava/lang/Math;->min(JJ)J
  1106. move-result-wide p1
  1107. invoke-virtual {v1, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
  1108. const-string p1, " content="
  1109. invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  1110. invoke-virtual {v6}, Lokio/Buffer;->readByteString()Lokio/ByteString;
  1111. move-result-object p1
  1112. invoke-virtual {p1}, Lokio/ByteString;->hex()Ljava/lang/String;
  1113. move-result-object p1
  1114. invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  1115. const/16 p1, 0x2026
  1116. invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
  1117. invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  1118. move-result-object p1
  1119. invoke-direct {v0, p1}, Ljava/io/EOFException;-><init>(Ljava/lang/String;)V
  1120. throw v0
  1121. :cond_3
  1122. new-instance v0, Ljava/lang/IllegalArgumentException;
  1123. new-instance v1, Ljava/lang/StringBuilder;
  1124. invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
  1125. const-string v2, "limit < 0: "
  1126. invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  1127. invoke-virtual {v1, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
  1128. invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  1129. move-result-object p1
  1130. invoke-direct {v0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  1131. throw v0
  1132. .end method
  1133. .method public request(J)Z
  1134. .locals 5
  1135. .annotation system Ldalvik/annotation/Throws;
  1136. value = {
  1137. Ljava/io/IOException;
  1138. }
  1139. .end annotation
  1140. const-wide/16 v0, 0x0
  1141. cmp-long v2, p1, v0
  1142. if-ltz v2, :cond_3
  1143. iget-boolean v0, p0, Lokio/RealBufferedSource;->closed:Z
  1144. if-nez v0, :cond_2
  1145. :cond_0
  1146. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  1147. iget-wide v1, v0, Lokio/Buffer;->size:J
  1148. cmp-long v3, v1, p1
  1149. if-gez v3, :cond_1
  1150. iget-object v1, p0, Lokio/RealBufferedSource;->source:Lokio/Source;
  1151. const-wide/16 v2, 0x2000
  1152. invoke-interface {v1, v0, v2, v3}, Lokio/Source;->read(Lokio/Buffer;J)J
  1153. move-result-wide v0
  1154. const-wide/16 v2, -0x1
  1155. cmp-long v4, v0, v2
  1156. if-nez v4, :cond_0
  1157. const/4 p1, 0x0
  1158. return p1
  1159. :cond_1
  1160. const/4 p1, 0x1
  1161. return p1
  1162. :cond_2
  1163. new-instance p1, Ljava/lang/IllegalStateException;
  1164. const-string p2, "closed"
  1165. invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  1166. throw p1
  1167. :cond_3
  1168. new-instance v0, Ljava/lang/IllegalArgumentException;
  1169. new-instance v1, Ljava/lang/StringBuilder;
  1170. invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
  1171. const-string v2, "byteCount < 0: "
  1172. invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  1173. invoke-virtual {v1, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
  1174. invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  1175. move-result-object p1
  1176. invoke-direct {v0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  1177. goto :goto_1
  1178. :goto_0
  1179. throw v0
  1180. :goto_1
  1181. goto :goto_0
  1182. .end method
  1183. .method public require(J)V
  1184. .locals 0
  1185. .annotation system Ldalvik/annotation/Throws;
  1186. value = {
  1187. Ljava/io/IOException;
  1188. }
  1189. .end annotation
  1190. invoke-virtual {p0, p1, p2}, Lokio/RealBufferedSource;->request(J)Z
  1191. move-result p1
  1192. if-eqz p1, :cond_0
  1193. return-void
  1194. :cond_0
  1195. new-instance p1, Ljava/io/EOFException;
  1196. invoke-direct {p1}, Ljava/io/EOFException;-><init>()V
  1197. throw p1
  1198. .end method
  1199. .method public select(Lokio/Options;)I
  1200. .locals 8
  1201. .annotation system Ldalvik/annotation/Throws;
  1202. value = {
  1203. Ljava/io/IOException;
  1204. }
  1205. .end annotation
  1206. iget-boolean v0, p0, Lokio/RealBufferedSource;->closed:Z
  1207. if-nez v0, :cond_3
  1208. :cond_0
  1209. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  1210. invoke-virtual {v0, p1}, Lokio/Buffer;->selectPrefix(Lokio/Options;)I
  1211. move-result v0
  1212. const/4 v1, -0x1
  1213. if-ne v0, v1, :cond_1
  1214. return v1
  1215. :cond_1
  1216. iget-object v2, p1, Lokio/Options;->byteStrings:[Lokio/ByteString;
  1217. aget-object v2, v2, v0
  1218. invoke-virtual {v2}, Lokio/ByteString;->size()I
  1219. move-result v2
  1220. int-to-long v2, v2
  1221. iget-object v4, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  1222. iget-wide v5, v4, Lokio/Buffer;->size:J
  1223. cmp-long v7, v2, v5
  1224. if-gtz v7, :cond_2
  1225. invoke-virtual {v4, v2, v3}, Lokio/Buffer;->skip(J)V
  1226. return v0
  1227. :cond_2
  1228. iget-object v0, p0, Lokio/RealBufferedSource;->source:Lokio/Source;
  1229. const-wide/16 v2, 0x2000
  1230. invoke-interface {v0, v4, v2, v3}, Lokio/Source;->read(Lokio/Buffer;J)J
  1231. move-result-wide v2
  1232. const-wide/16 v4, -0x1
  1233. cmp-long v0, v2, v4
  1234. if-nez v0, :cond_0
  1235. return v1
  1236. :cond_3
  1237. new-instance p1, Ljava/lang/IllegalStateException;
  1238. const-string v0, "closed"
  1239. invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  1240. goto :goto_1
  1241. :goto_0
  1242. throw p1
  1243. :goto_1
  1244. goto :goto_0
  1245. .end method
  1246. .method public skip(J)V
  1247. .locals 6
  1248. .annotation system Ldalvik/annotation/Throws;
  1249. value = {
  1250. Ljava/io/IOException;
  1251. }
  1252. .end annotation
  1253. iget-boolean v0, p0, Lokio/RealBufferedSource;->closed:Z
  1254. if-nez v0, :cond_3
  1255. :goto_0
  1256. const-wide/16 v0, 0x0
  1257. cmp-long v2, p1, v0
  1258. if-lez v2, :cond_2
  1259. iget-object v2, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  1260. iget-wide v3, v2, Lokio/Buffer;->size:J
  1261. cmp-long v5, v3, v0
  1262. if-nez v5, :cond_1
  1263. iget-object v0, p0, Lokio/RealBufferedSource;->source:Lokio/Source;
  1264. const-wide/16 v3, 0x2000
  1265. invoke-interface {v0, v2, v3, v4}, Lokio/Source;->read(Lokio/Buffer;J)J
  1266. move-result-wide v0
  1267. const-wide/16 v2, -0x1
  1268. cmp-long v4, v0, v2
  1269. if-eqz v4, :cond_0
  1270. goto :goto_1
  1271. :cond_0
  1272. new-instance p1, Ljava/io/EOFException;
  1273. invoke-direct {p1}, Ljava/io/EOFException;-><init>()V
  1274. throw p1
  1275. :cond_1
  1276. :goto_1
  1277. iget-object v0, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  1278. invoke-virtual {v0}, Lokio/Buffer;->size()J
  1279. move-result-wide v0
  1280. invoke-static {p1, p2, v0, v1}, Ljava/lang/Math;->min(JJ)J
  1281. move-result-wide v0
  1282. iget-object v2, p0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  1283. invoke-virtual {v2, v0, v1}, Lokio/Buffer;->skip(J)V
  1284. sub-long/2addr p1, v0
  1285. goto :goto_0
  1286. :cond_2
  1287. return-void
  1288. :cond_3
  1289. new-instance p1, Ljava/lang/IllegalStateException;
  1290. const-string p2, "closed"
  1291. invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  1292. goto :goto_3
  1293. :goto_2
  1294. throw p1
  1295. :goto_3
  1296. goto :goto_2
  1297. .end method
  1298. .method public timeout()Lokio/Timeout;
  1299. .locals 1
  1300. iget-object v0, p0, Lokio/RealBufferedSource;->source:Lokio/Source;
  1301. invoke-interface {v0}, Lokio/Source;->timeout()Lokio/Timeout;
  1302. move-result-object v0
  1303. return-object v0
  1304. .end method
  1305. .method public toString()Ljava/lang/String;
  1306. .locals 2
  1307. new-instance v0, Ljava/lang/StringBuilder;
  1308. invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
  1309. const-string v1, "buffer("
  1310. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  1311. iget-object v1, p0, Lokio/RealBufferedSource;->source:Lokio/Source;
  1312. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
  1313. const-string v1, ")"
  1314. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  1315. invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  1316. move-result-object v0
  1317. return-object v0
  1318. .end method