SegmentedByteString.smali 18 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025
  1. .class final Lokio/SegmentedByteString;
  2. .super Lokio/ByteString;
  3. .source ""
  4. # instance fields
  5. .field final transient directory:[I
  6. .field final transient segments:[[B
  7. # direct methods
  8. .method constructor <init>(Lokio/Buffer;I)V
  9. .locals 7
  10. const/4 v0, 0x0
  11. invoke-direct {p0, v0}, Lokio/ByteString;-><init>([B)V
  12. iget-wide v1, p1, Lokio/Buffer;->size:J
  13. int-to-long v5, p2
  14. const-wide/16 v3, 0x0
  15. invoke-static/range {v1 .. v6}, Lokio/Util;->checkOffsetAndCount(JJJ)V
  16. iget-object v0, p1, Lokio/Buffer;->head:Lokio/Segment;
  17. const/4 v1, 0x0
  18. move-object v3, v0
  19. const/4 v0, 0x0
  20. const/4 v2, 0x0
  21. :goto_0
  22. if-ge v0, p2, :cond_1
  23. iget v4, v3, Lokio/Segment;->limit:I
  24. iget v5, v3, Lokio/Segment;->pos:I
  25. if-eq v4, v5, :cond_0
  26. sub-int/2addr v4, v5
  27. add-int/2addr v0, v4
  28. add-int/lit8 v2, v2, 0x1
  29. iget-object v3, v3, Lokio/Segment;->next:Lokio/Segment;
  30. goto :goto_0
  31. :cond_0
  32. new-instance p1, Ljava/lang/AssertionError;
  33. const-string p2, "s.limit == s.pos"
  34. invoke-direct {p1, p2}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
  35. throw p1
  36. :cond_1
  37. new-array v0, v2, [[B
  38. iput-object v0, p0, Lokio/SegmentedByteString;->segments:[[B
  39. mul-int/lit8 v2, v2, 0x2
  40. new-array v0, v2, [I
  41. iput-object v0, p0, Lokio/SegmentedByteString;->directory:[I
  42. iget-object p1, p1, Lokio/Buffer;->head:Lokio/Segment;
  43. move-object v0, p1
  44. const/4 p1, 0x0
  45. :goto_1
  46. if-ge v1, p2, :cond_3
  47. iget-object v2, p0, Lokio/SegmentedByteString;->segments:[[B
  48. iget-object v3, v0, Lokio/Segment;->data:[B
  49. aput-object v3, v2, p1
  50. iget v2, v0, Lokio/Segment;->limit:I
  51. iget v3, v0, Lokio/Segment;->pos:I
  52. sub-int/2addr v2, v3
  53. add-int/2addr v1, v2
  54. if-le v1, p2, :cond_2
  55. move v1, p2
  56. :cond_2
  57. iget-object v2, p0, Lokio/SegmentedByteString;->directory:[I
  58. aput v1, v2, p1
  59. iget-object v3, p0, Lokio/SegmentedByteString;->segments:[[B
  60. array-length v3, v3
  61. add-int/2addr v3, p1
  62. iget v4, v0, Lokio/Segment;->pos:I
  63. aput v4, v2, v3
  64. const/4 v2, 0x1
  65. iput-boolean v2, v0, Lokio/Segment;->shared:Z
  66. add-int/lit8 p1, p1, 0x1
  67. iget-object v0, v0, Lokio/Segment;->next:Lokio/Segment;
  68. goto :goto_1
  69. :cond_3
  70. return-void
  71. .end method
  72. .method private segment(I)I
  73. .locals 3
  74. iget-object v0, p0, Lokio/SegmentedByteString;->directory:[I
  75. iget-object v1, p0, Lokio/SegmentedByteString;->segments:[[B
  76. array-length v1, v1
  77. add-int/lit8 p1, p1, 0x1
  78. const/4 v2, 0x0
  79. invoke-static {v0, v2, v1, p1}, Ljava/util/Arrays;->binarySearch([IIII)I
  80. move-result p1
  81. if-ltz p1, :cond_0
  82. goto :goto_0
  83. :cond_0
  84. xor-int/lit8 p1, p1, -0x1
  85. :goto_0
  86. return p1
  87. .end method
  88. .method private toByteString()Lokio/ByteString;
  89. .locals 2
  90. new-instance v0, Lokio/ByteString;
  91. invoke-virtual {p0}, Lokio/SegmentedByteString;->toByteArray()[B
  92. move-result-object v1
  93. invoke-direct {v0, v1}, Lokio/ByteString;-><init>([B)V
  94. return-object v0
  95. .end method
  96. .method private writeReplace()Ljava/lang/Object;
  97. .locals 1
  98. invoke-direct {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
  99. move-result-object v0
  100. return-object v0
  101. .end method
  102. # virtual methods
  103. .method public asByteBuffer()Ljava/nio/ByteBuffer;
  104. .locals 1
  105. invoke-virtual {p0}, Lokio/SegmentedByteString;->toByteArray()[B
  106. move-result-object v0
  107. invoke-static {v0}, Ljava/nio/ByteBuffer;->wrap([B)Ljava/nio/ByteBuffer;
  108. move-result-object v0
  109. invoke-virtual {v0}, Ljava/nio/ByteBuffer;->asReadOnlyBuffer()Ljava/nio/ByteBuffer;
  110. move-result-object v0
  111. return-object v0
  112. .end method
  113. .method public base64()Ljava/lang/String;
  114. .locals 1
  115. invoke-direct {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
  116. move-result-object v0
  117. invoke-virtual {v0}, Lokio/ByteString;->base64()Ljava/lang/String;
  118. move-result-object v0
  119. return-object v0
  120. .end method
  121. .method public base64Url()Ljava/lang/String;
  122. .locals 1
  123. invoke-direct {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
  124. move-result-object v0
  125. invoke-virtual {v0}, Lokio/ByteString;->base64Url()Ljava/lang/String;
  126. move-result-object v0
  127. return-object v0
  128. .end method
  129. .method public equals(Ljava/lang/Object;)Z
  130. .locals 4
  131. const/4 v0, 0x1
  132. if-ne p1, p0, :cond_0
  133. return v0
  134. :cond_0
  135. instance-of v1, p1, Lokio/ByteString;
  136. const/4 v2, 0x0
  137. if-eqz v1, :cond_1
  138. check-cast p1, Lokio/ByteString;
  139. invoke-virtual {p1}, Lokio/ByteString;->size()I
  140. move-result v1
  141. invoke-virtual {p0}, Lokio/SegmentedByteString;->size()I
  142. move-result v3
  143. if-ne v1, v3, :cond_1
  144. invoke-virtual {p0}, Lokio/SegmentedByteString;->size()I
  145. move-result v1
  146. invoke-virtual {p0, v2, p1, v2, v1}, Lokio/SegmentedByteString;->rangeEquals(ILokio/ByteString;II)Z
  147. move-result p1
  148. if-eqz p1, :cond_1
  149. goto :goto_0
  150. :cond_1
  151. const/4 v0, 0x0
  152. :goto_0
  153. return v0
  154. .end method
  155. .method public getByte(I)B
  156. .locals 7
  157. iget-object v0, p0, Lokio/SegmentedByteString;->directory:[I
  158. iget-object v1, p0, Lokio/SegmentedByteString;->segments:[[B
  159. array-length v1, v1
  160. add-int/lit8 v1, v1, -0x1
  161. aget v0, v0, v1
  162. int-to-long v1, v0
  163. int-to-long v3, p1
  164. const-wide/16 v5, 0x1
  165. invoke-static/range {v1 .. v6}, Lokio/Util;->checkOffsetAndCount(JJJ)V
  166. invoke-direct {p0, p1}, Lokio/SegmentedByteString;->segment(I)I
  167. move-result v0
  168. if-nez v0, :cond_0
  169. const/4 v1, 0x0
  170. goto :goto_0
  171. :cond_0
  172. iget-object v1, p0, Lokio/SegmentedByteString;->directory:[I
  173. add-int/lit8 v2, v0, -0x1
  174. aget v1, v1, v2
  175. :goto_0
  176. iget-object v2, p0, Lokio/SegmentedByteString;->directory:[I
  177. iget-object v3, p0, Lokio/SegmentedByteString;->segments:[[B
  178. array-length v4, v3
  179. add-int/2addr v4, v0
  180. aget v2, v2, v4
  181. aget-object v0, v3, v0
  182. sub-int/2addr p1, v1
  183. add-int/2addr p1, v2
  184. aget-byte p1, v0, p1
  185. return p1
  186. .end method
  187. .method public hashCode()I
  188. .locals 8
  189. iget v0, p0, Lokio/ByteString;->hashCode:I
  190. if-eqz v0, :cond_0
  191. return v0
  192. :cond_0
  193. iget-object v0, p0, Lokio/SegmentedByteString;->segments:[[B
  194. array-length v0, v0
  195. const/4 v1, 0x0
  196. const/4 v2, 0x1
  197. const/4 v3, 0x0
  198. :goto_0
  199. if-ge v1, v0, :cond_2
  200. iget-object v4, p0, Lokio/SegmentedByteString;->segments:[[B
  201. aget-object v4, v4, v1
  202. iget-object v5, p0, Lokio/SegmentedByteString;->directory:[I
  203. add-int v6, v0, v1
  204. aget v6, v5, v6
  205. aget v5, v5, v1
  206. sub-int v3, v5, v3
  207. add-int/2addr v3, v6
  208. :goto_1
  209. if-ge v6, v3, :cond_1
  210. mul-int/lit8 v2, v2, 0x1f
  211. aget-byte v7, v4, v6
  212. add-int/2addr v2, v7
  213. add-int/lit8 v6, v6, 0x1
  214. goto :goto_1
  215. :cond_1
  216. add-int/lit8 v1, v1, 0x1
  217. move v3, v5
  218. goto :goto_0
  219. :cond_2
  220. iput v2, p0, Lokio/ByteString;->hashCode:I
  221. return v2
  222. .end method
  223. .method public hex()Ljava/lang/String;
  224. .locals 1
  225. invoke-direct {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
  226. move-result-object v0
  227. invoke-virtual {v0}, Lokio/ByteString;->hex()Ljava/lang/String;
  228. move-result-object v0
  229. return-object v0
  230. .end method
  231. .method public hmacSha1(Lokio/ByteString;)Lokio/ByteString;
  232. .locals 1
  233. invoke-direct {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
  234. move-result-object v0
  235. invoke-virtual {v0, p1}, Lokio/ByteString;->hmacSha1(Lokio/ByteString;)Lokio/ByteString;
  236. move-result-object p1
  237. return-object p1
  238. .end method
  239. .method public hmacSha256(Lokio/ByteString;)Lokio/ByteString;
  240. .locals 1
  241. invoke-direct {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
  242. move-result-object v0
  243. invoke-virtual {v0, p1}, Lokio/ByteString;->hmacSha256(Lokio/ByteString;)Lokio/ByteString;
  244. move-result-object p1
  245. return-object p1
  246. .end method
  247. .method public indexOf([BI)I
  248. .locals 1
  249. invoke-direct {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
  250. move-result-object v0
  251. invoke-virtual {v0, p1, p2}, Lokio/ByteString;->indexOf([BI)I
  252. move-result p1
  253. return p1
  254. .end method
  255. .method internalArray()[B
  256. .locals 1
  257. invoke-virtual {p0}, Lokio/SegmentedByteString;->toByteArray()[B
  258. move-result-object v0
  259. return-object v0
  260. .end method
  261. .method public lastIndexOf([BI)I
  262. .locals 1
  263. invoke-direct {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
  264. move-result-object v0
  265. invoke-virtual {v0, p1, p2}, Lokio/ByteString;->lastIndexOf([BI)I
  266. move-result p1
  267. return p1
  268. .end method
  269. .method public md5()Lokio/ByteString;
  270. .locals 1
  271. invoke-direct {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
  272. move-result-object v0
  273. invoke-virtual {v0}, Lokio/ByteString;->md5()Lokio/ByteString;
  274. move-result-object v0
  275. return-object v0
  276. .end method
  277. .method public rangeEquals(ILokio/ByteString;II)Z
  278. .locals 7
  279. const/4 v0, 0x0
  280. if-ltz p1, :cond_4
  281. invoke-virtual {p0}, Lokio/SegmentedByteString;->size()I
  282. move-result v1
  283. sub-int/2addr v1, p4
  284. if-le p1, v1, :cond_0
  285. goto :goto_2
  286. :cond_0
  287. invoke-direct {p0, p1}, Lokio/SegmentedByteString;->segment(I)I
  288. move-result v1
  289. :goto_0
  290. if-lez p4, :cond_3
  291. if-nez v1, :cond_1
  292. const/4 v2, 0x0
  293. goto :goto_1
  294. :cond_1
  295. iget-object v2, p0, Lokio/SegmentedByteString;->directory:[I
  296. add-int/lit8 v3, v1, -0x1
  297. aget v2, v2, v3
  298. :goto_1
  299. iget-object v3, p0, Lokio/SegmentedByteString;->directory:[I
  300. aget v3, v3, v1
  301. sub-int/2addr v3, v2
  302. add-int/2addr v3, v2
  303. sub-int/2addr v3, p1
  304. invoke-static {p4, v3}, Ljava/lang/Math;->min(II)I
  305. move-result v3
  306. iget-object v4, p0, Lokio/SegmentedByteString;->directory:[I
  307. iget-object v5, p0, Lokio/SegmentedByteString;->segments:[[B
  308. array-length v6, v5
  309. add-int/2addr v6, v1
  310. aget v4, v4, v6
  311. sub-int v2, p1, v2
  312. add-int/2addr v2, v4
  313. aget-object v4, v5, v1
  314. invoke-virtual {p2, p3, v4, v2, v3}, Lokio/ByteString;->rangeEquals(I[BII)Z
  315. move-result v2
  316. if-nez v2, :cond_2
  317. return v0
  318. :cond_2
  319. add-int/2addr p1, v3
  320. add-int/2addr p3, v3
  321. sub-int/2addr p4, v3
  322. add-int/lit8 v1, v1, 0x1
  323. goto :goto_0
  324. :cond_3
  325. const/4 p1, 0x1
  326. return p1
  327. :cond_4
  328. :goto_2
  329. return v0
  330. .end method
  331. .method public rangeEquals(I[BII)Z
  332. .locals 7
  333. const/4 v0, 0x0
  334. if-ltz p1, :cond_4
  335. invoke-virtual {p0}, Lokio/SegmentedByteString;->size()I
  336. move-result v1
  337. sub-int/2addr v1, p4
  338. if-gt p1, v1, :cond_4
  339. if-ltz p3, :cond_4
  340. array-length v1, p2
  341. sub-int/2addr v1, p4
  342. if-le p3, v1, :cond_0
  343. goto :goto_2
  344. :cond_0
  345. invoke-direct {p0, p1}, Lokio/SegmentedByteString;->segment(I)I
  346. move-result v1
  347. :goto_0
  348. if-lez p4, :cond_3
  349. if-nez v1, :cond_1
  350. const/4 v2, 0x0
  351. goto :goto_1
  352. :cond_1
  353. iget-object v2, p0, Lokio/SegmentedByteString;->directory:[I
  354. add-int/lit8 v3, v1, -0x1
  355. aget v2, v2, v3
  356. :goto_1
  357. iget-object v3, p0, Lokio/SegmentedByteString;->directory:[I
  358. aget v3, v3, v1
  359. sub-int/2addr v3, v2
  360. add-int/2addr v3, v2
  361. sub-int/2addr v3, p1
  362. invoke-static {p4, v3}, Ljava/lang/Math;->min(II)I
  363. move-result v3
  364. iget-object v4, p0, Lokio/SegmentedByteString;->directory:[I
  365. iget-object v5, p0, Lokio/SegmentedByteString;->segments:[[B
  366. array-length v6, v5
  367. add-int/2addr v6, v1
  368. aget v4, v4, v6
  369. sub-int v2, p1, v2
  370. add-int/2addr v2, v4
  371. aget-object v4, v5, v1
  372. invoke-static {v4, v2, p2, p3, v3}, Lokio/Util;->arrayRangeEquals([BI[BII)Z
  373. move-result v2
  374. if-nez v2, :cond_2
  375. return v0
  376. :cond_2
  377. add-int/2addr p1, v3
  378. add-int/2addr p3, v3
  379. sub-int/2addr p4, v3
  380. add-int/lit8 v1, v1, 0x1
  381. goto :goto_0
  382. :cond_3
  383. const/4 p1, 0x1
  384. return p1
  385. :cond_4
  386. :goto_2
  387. return v0
  388. .end method
  389. .method public sha1()Lokio/ByteString;
  390. .locals 1
  391. invoke-direct {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
  392. move-result-object v0
  393. invoke-virtual {v0}, Lokio/ByteString;->sha1()Lokio/ByteString;
  394. move-result-object v0
  395. return-object v0
  396. .end method
  397. .method public sha256()Lokio/ByteString;
  398. .locals 1
  399. invoke-direct {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
  400. move-result-object v0
  401. invoke-virtual {v0}, Lokio/ByteString;->sha256()Lokio/ByteString;
  402. move-result-object v0
  403. return-object v0
  404. .end method
  405. .method public size()I
  406. .locals 2
  407. iget-object v0, p0, Lokio/SegmentedByteString;->directory:[I
  408. iget-object v1, p0, Lokio/SegmentedByteString;->segments:[[B
  409. array-length v1, v1
  410. add-int/lit8 v1, v1, -0x1
  411. aget v0, v0, v1
  412. return v0
  413. .end method
  414. .method public string(Ljava/nio/charset/Charset;)Ljava/lang/String;
  415. .locals 1
  416. invoke-direct {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
  417. move-result-object v0
  418. invoke-virtual {v0, p1}, Lokio/ByteString;->string(Ljava/nio/charset/Charset;)Ljava/lang/String;
  419. move-result-object p1
  420. return-object p1
  421. .end method
  422. .method public substring(I)Lokio/ByteString;
  423. .locals 1
  424. invoke-direct {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
  425. move-result-object v0
  426. invoke-virtual {v0, p1}, Lokio/ByteString;->substring(I)Lokio/ByteString;
  427. move-result-object p1
  428. return-object p1
  429. .end method
  430. .method public substring(II)Lokio/ByteString;
  431. .locals 1
  432. invoke-direct {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
  433. move-result-object v0
  434. invoke-virtual {v0, p1, p2}, Lokio/ByteString;->substring(II)Lokio/ByteString;
  435. move-result-object p1
  436. return-object p1
  437. .end method
  438. .method public toAsciiLowercase()Lokio/ByteString;
  439. .locals 1
  440. invoke-direct {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
  441. move-result-object v0
  442. invoke-virtual {v0}, Lokio/ByteString;->toAsciiLowercase()Lokio/ByteString;
  443. move-result-object v0
  444. return-object v0
  445. .end method
  446. .method public toAsciiUppercase()Lokio/ByteString;
  447. .locals 1
  448. invoke-direct {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
  449. move-result-object v0
  450. invoke-virtual {v0}, Lokio/ByteString;->toAsciiUppercase()Lokio/ByteString;
  451. move-result-object v0
  452. return-object v0
  453. .end method
  454. .method public toByteArray()[B
  455. .locals 8
  456. iget-object v0, p0, Lokio/SegmentedByteString;->directory:[I
  457. iget-object v1, p0, Lokio/SegmentedByteString;->segments:[[B
  458. array-length v2, v1
  459. add-int/lit8 v2, v2, -0x1
  460. aget v0, v0, v2
  461. new-array v0, v0, [B
  462. array-length v1, v1
  463. const/4 v2, 0x0
  464. const/4 v3, 0x0
  465. :goto_0
  466. if-ge v2, v1, :cond_0
  467. iget-object v4, p0, Lokio/SegmentedByteString;->directory:[I
  468. add-int v5, v1, v2
  469. aget v5, v4, v5
  470. aget v4, v4, v2
  471. iget-object v6, p0, Lokio/SegmentedByteString;->segments:[[B
  472. aget-object v6, v6, v2
  473. sub-int v7, v4, v3
  474. invoke-static {v6, v5, v0, v3, v7}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
  475. add-int/lit8 v2, v2, 0x1
  476. move v3, v4
  477. goto :goto_0
  478. :cond_0
  479. return-object v0
  480. .end method
  481. .method public toString()Ljava/lang/String;
  482. .locals 1
  483. invoke-direct {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
  484. move-result-object v0
  485. invoke-virtual {v0}, Lokio/ByteString;->toString()Ljava/lang/String;
  486. move-result-object v0
  487. return-object v0
  488. .end method
  489. .method public utf8()Ljava/lang/String;
  490. .locals 1
  491. invoke-direct {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
  492. move-result-object v0
  493. invoke-virtual {v0}, Lokio/ByteString;->utf8()Ljava/lang/String;
  494. move-result-object v0
  495. return-object v0
  496. .end method
  497. .method public write(Ljava/io/OutputStream;)V
  498. .locals 6
  499. .annotation system Ldalvik/annotation/Throws;
  500. value = {
  501. Ljava/io/IOException;
  502. }
  503. .end annotation
  504. if-eqz p1, :cond_1
  505. iget-object v0, p0, Lokio/SegmentedByteString;->segments:[[B
  506. array-length v0, v0
  507. const/4 v1, 0x0
  508. const/4 v2, 0x0
  509. :goto_0
  510. if-ge v1, v0, :cond_0
  511. iget-object v3, p0, Lokio/SegmentedByteString;->directory:[I
  512. add-int v4, v0, v1
  513. aget v4, v3, v4
  514. aget v3, v3, v1
  515. iget-object v5, p0, Lokio/SegmentedByteString;->segments:[[B
  516. aget-object v5, v5, v1
  517. sub-int v2, v3, v2
  518. invoke-virtual {p1, v5, v4, v2}, Ljava/io/OutputStream;->write([BII)V
  519. add-int/lit8 v1, v1, 0x1
  520. move v2, v3
  521. goto :goto_0
  522. :cond_0
  523. return-void
  524. :cond_1
  525. new-instance p1, Ljava/lang/IllegalArgumentException;
  526. const-string v0, "out == null"
  527. invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  528. goto :goto_2
  529. :goto_1
  530. throw p1
  531. :goto_2
  532. goto :goto_1
  533. .end method
  534. .method write(Lokio/Buffer;)V
  535. .locals 8
  536. iget-object v0, p0, Lokio/SegmentedByteString;->segments:[[B
  537. array-length v0, v0
  538. const/4 v1, 0x0
  539. const/4 v2, 0x0
  540. :goto_0
  541. if-ge v1, v0, :cond_1
  542. iget-object v3, p0, Lokio/SegmentedByteString;->directory:[I
  543. add-int v4, v0, v1
  544. aget v4, v3, v4
  545. aget v3, v3, v1
  546. new-instance v5, Lokio/Segment;
  547. iget-object v6, p0, Lokio/SegmentedByteString;->segments:[[B
  548. aget-object v6, v6, v1
  549. add-int v7, v4, v3
  550. sub-int/2addr v7, v2
  551. invoke-direct {v5, v6, v4, v7}, Lokio/Segment;-><init>([BII)V
  552. iget-object v2, p1, Lokio/Buffer;->head:Lokio/Segment;
  553. if-nez v2, :cond_0
  554. iput-object v5, v5, Lokio/Segment;->prev:Lokio/Segment;
  555. iput-object v5, v5, Lokio/Segment;->next:Lokio/Segment;
  556. iput-object v5, p1, Lokio/Buffer;->head:Lokio/Segment;
  557. goto :goto_1
  558. :cond_0
  559. iget-object v2, v2, Lokio/Segment;->prev:Lokio/Segment;
  560. invoke-virtual {v2, v5}, Lokio/Segment;->push(Lokio/Segment;)Lokio/Segment;
  561. :goto_1
  562. add-int/lit8 v1, v1, 0x1
  563. move v2, v3
  564. goto :goto_0
  565. :cond_1
  566. iget-wide v0, p1, Lokio/Buffer;->size:J
  567. int-to-long v2, v2
  568. add-long/2addr v0, v2
  569. iput-wide v0, p1, Lokio/Buffer;->size:J
  570. return-void
  571. .end method