RealBufferedSink.smali 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977
  1. .class final Lokio/RealBufferedSink;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # interfaces
  5. .implements Lokio/BufferedSink;
  6. # instance fields
  7. .field public final buffer:Lokio/Buffer;
  8. .field closed:Z
  9. .field public final sink:Lokio/Sink;
  10. # direct methods
  11. .method constructor <init>(Lokio/Sink;)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/RealBufferedSink;->buffer:Lokio/Buffer;
  17. if-eqz p1, :cond_0
  18. iput-object p1, p0, Lokio/RealBufferedSink;->sink:Lokio/Sink;
  19. return-void
  20. :cond_0
  21. new-instance p1, Ljava/lang/NullPointerException;
  22. const-string v0, "sink == 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/RealBufferedSink;->buffer:Lokio/Buffer;
  30. return-object v0
  31. .end method
  32. .method public close()V
  33. .locals 6
  34. .annotation system Ldalvik/annotation/Throws;
  35. value = {
  36. Ljava/io/IOException;
  37. }
  38. .end annotation
  39. iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
  40. if-eqz v0, :cond_0
  41. return-void
  42. :cond_0
  43. const/4 v0, 0x0
  44. :try_start_0
  45. iget-object v1, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  46. iget-wide v1, v1, Lokio/Buffer;->size:J
  47. const-wide/16 v3, 0x0
  48. cmp-long v5, v1, v3
  49. if-lez v5, :cond_1
  50. iget-object v1, p0, Lokio/RealBufferedSink;->sink:Lokio/Sink;
  51. iget-object v2, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  52. iget-object v3, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  53. iget-wide v3, v3, Lokio/Buffer;->size:J
  54. invoke-interface {v1, v2, v3, v4}, Lokio/Sink;->write(Lokio/Buffer;J)V
  55. :try_end_0
  56. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  57. goto :goto_0
  58. :catchall_0
  59. move-exception v0
  60. :cond_1
  61. :goto_0
  62. :try_start_1
  63. iget-object v1, p0, Lokio/RealBufferedSink;->sink:Lokio/Sink;
  64. invoke-interface {v1}, Lokio/Sink;->close()V
  65. :try_end_1
  66. .catchall {:try_start_1 .. :try_end_1} :catchall_1
  67. goto :goto_1
  68. :catchall_1
  69. move-exception v1
  70. if-nez v0, :cond_2
  71. move-object v0, v1
  72. :cond_2
  73. :goto_1
  74. const/4 v1, 0x1
  75. iput-boolean v1, p0, Lokio/RealBufferedSink;->closed:Z
  76. if-eqz v0, :cond_3
  77. invoke-static {v0}, Lokio/Util;->sneakyRethrow(Ljava/lang/Throwable;)V
  78. :cond_3
  79. return-void
  80. .end method
  81. .method public emit()Lokio/BufferedSink;
  82. .locals 5
  83. .annotation system Ldalvik/annotation/Throws;
  84. value = {
  85. Ljava/io/IOException;
  86. }
  87. .end annotation
  88. iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
  89. if-nez v0, :cond_1
  90. iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  91. invoke-virtual {v0}, Lokio/Buffer;->size()J
  92. move-result-wide v0
  93. const-wide/16 v2, 0x0
  94. cmp-long v4, v0, v2
  95. if-lez v4, :cond_0
  96. iget-object v2, p0, Lokio/RealBufferedSink;->sink:Lokio/Sink;
  97. iget-object v3, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  98. invoke-interface {v2, v3, v0, v1}, Lokio/Sink;->write(Lokio/Buffer;J)V
  99. :cond_0
  100. return-object p0
  101. :cond_1
  102. new-instance v0, Ljava/lang/IllegalStateException;
  103. const-string v1, "closed"
  104. invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  105. throw v0
  106. .end method
  107. .method public emitCompleteSegments()Lokio/BufferedSink;
  108. .locals 5
  109. .annotation system Ldalvik/annotation/Throws;
  110. value = {
  111. Ljava/io/IOException;
  112. }
  113. .end annotation
  114. iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
  115. if-nez v0, :cond_1
  116. iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  117. invoke-virtual {v0}, Lokio/Buffer;->completeSegmentByteCount()J
  118. move-result-wide v0
  119. const-wide/16 v2, 0x0
  120. cmp-long v4, v0, v2
  121. if-lez v4, :cond_0
  122. iget-object v2, p0, Lokio/RealBufferedSink;->sink:Lokio/Sink;
  123. iget-object v3, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  124. invoke-interface {v2, v3, v0, v1}, Lokio/Sink;->write(Lokio/Buffer;J)V
  125. :cond_0
  126. return-object p0
  127. :cond_1
  128. new-instance v0, Ljava/lang/IllegalStateException;
  129. const-string v1, "closed"
  130. invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  131. throw v0
  132. .end method
  133. .method public flush()V
  134. .locals 6
  135. .annotation system Ldalvik/annotation/Throws;
  136. value = {
  137. Ljava/io/IOException;
  138. }
  139. .end annotation
  140. iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
  141. if-nez v0, :cond_1
  142. iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  143. iget-wide v1, v0, Lokio/Buffer;->size:J
  144. const-wide/16 v3, 0x0
  145. cmp-long v5, v1, v3
  146. if-lez v5, :cond_0
  147. iget-object v3, p0, Lokio/RealBufferedSink;->sink:Lokio/Sink;
  148. invoke-interface {v3, v0, v1, v2}, Lokio/Sink;->write(Lokio/Buffer;J)V
  149. :cond_0
  150. iget-object v0, p0, Lokio/RealBufferedSink;->sink:Lokio/Sink;
  151. invoke-interface {v0}, Lokio/Sink;->flush()V
  152. return-void
  153. :cond_1
  154. new-instance v0, Ljava/lang/IllegalStateException;
  155. const-string v1, "closed"
  156. invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  157. throw v0
  158. .end method
  159. .method public outputStream()Ljava/io/OutputStream;
  160. .locals 1
  161. new-instance v0, Lokio/RealBufferedSink$1;
  162. invoke-direct {v0, p0}, Lokio/RealBufferedSink$1;-><init>(Lokio/RealBufferedSink;)V
  163. return-object v0
  164. .end method
  165. .method public timeout()Lokio/Timeout;
  166. .locals 1
  167. iget-object v0, p0, Lokio/RealBufferedSink;->sink:Lokio/Sink;
  168. invoke-interface {v0}, Lokio/Sink;->timeout()Lokio/Timeout;
  169. move-result-object v0
  170. return-object v0
  171. .end method
  172. .method public toString()Ljava/lang/String;
  173. .locals 2
  174. new-instance v0, Ljava/lang/StringBuilder;
  175. invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
  176. const-string v1, "buffer("
  177. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  178. iget-object v1, p0, Lokio/RealBufferedSink;->sink:Lokio/Sink;
  179. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
  180. const-string v1, ")"
  181. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  182. invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  183. move-result-object v0
  184. return-object v0
  185. .end method
  186. .method public write(Lokio/ByteString;)Lokio/BufferedSink;
  187. .locals 1
  188. .annotation system Ldalvik/annotation/Throws;
  189. value = {
  190. Ljava/io/IOException;
  191. }
  192. .end annotation
  193. iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
  194. if-nez v0, :cond_0
  195. iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  196. invoke-virtual {v0, p1}, Lokio/Buffer;->write(Lokio/ByteString;)Lokio/Buffer;
  197. invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
  198. move-result-object p1
  199. return-object p1
  200. :cond_0
  201. new-instance p1, Ljava/lang/IllegalStateException;
  202. const-string v0, "closed"
  203. invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  204. throw p1
  205. .end method
  206. .method public write(Lokio/Source;J)Lokio/BufferedSink;
  207. .locals 5
  208. .annotation system Ldalvik/annotation/Throws;
  209. value = {
  210. Ljava/io/IOException;
  211. }
  212. .end annotation
  213. :goto_0
  214. const-wide/16 v0, 0x0
  215. cmp-long v2, p2, v0
  216. if-lez v2, :cond_1
  217. iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  218. invoke-interface {p1, v0, p2, p3}, Lokio/Source;->read(Lokio/Buffer;J)J
  219. move-result-wide v0
  220. const-wide/16 v2, -0x1
  221. cmp-long v4, v0, v2
  222. if-eqz v4, :cond_0
  223. sub-long/2addr p2, v0
  224. invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
  225. goto :goto_0
  226. :cond_0
  227. new-instance p1, Ljava/io/EOFException;
  228. invoke-direct {p1}, Ljava/io/EOFException;-><init>()V
  229. throw p1
  230. :cond_1
  231. return-object p0
  232. .end method
  233. .method public write([B)Lokio/BufferedSink;
  234. .locals 1
  235. .annotation system Ldalvik/annotation/Throws;
  236. value = {
  237. Ljava/io/IOException;
  238. }
  239. .end annotation
  240. iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
  241. if-nez v0, :cond_0
  242. iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  243. invoke-virtual {v0, p1}, Lokio/Buffer;->write([B)Lokio/Buffer;
  244. invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
  245. move-result-object p1
  246. return-object p1
  247. :cond_0
  248. new-instance p1, Ljava/lang/IllegalStateException;
  249. const-string v0, "closed"
  250. invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  251. throw p1
  252. .end method
  253. .method public write([BII)Lokio/BufferedSink;
  254. .locals 1
  255. .annotation system Ldalvik/annotation/Throws;
  256. value = {
  257. Ljava/io/IOException;
  258. }
  259. .end annotation
  260. iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
  261. if-nez v0, :cond_0
  262. iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  263. invoke-virtual {v0, p1, p2, p3}, Lokio/Buffer;->write([BII)Lokio/Buffer;
  264. invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
  265. move-result-object p1
  266. return-object p1
  267. :cond_0
  268. new-instance p1, Ljava/lang/IllegalStateException;
  269. const-string p2, "closed"
  270. invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  271. throw p1
  272. .end method
  273. .method public write(Lokio/Buffer;J)V
  274. .locals 1
  275. .annotation system Ldalvik/annotation/Throws;
  276. value = {
  277. Ljava/io/IOException;
  278. }
  279. .end annotation
  280. iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
  281. if-nez v0, :cond_0
  282. iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  283. invoke-virtual {v0, p1, p2, p3}, Lokio/Buffer;->write(Lokio/Buffer;J)V
  284. invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
  285. return-void
  286. :cond_0
  287. new-instance p1, Ljava/lang/IllegalStateException;
  288. const-string p2, "closed"
  289. invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  290. throw p1
  291. .end method
  292. .method public writeAll(Lokio/Source;)J
  293. .locals 7
  294. .annotation system Ldalvik/annotation/Throws;
  295. value = {
  296. Ljava/io/IOException;
  297. }
  298. .end annotation
  299. if-eqz p1, :cond_1
  300. const-wide/16 v0, 0x0
  301. :goto_0
  302. iget-object v2, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  303. const-wide/16 v3, 0x2000
  304. invoke-interface {p1, v2, v3, v4}, Lokio/Source;->read(Lokio/Buffer;J)J
  305. move-result-wide v2
  306. const-wide/16 v4, -0x1
  307. cmp-long v6, v2, v4
  308. if-eqz v6, :cond_0
  309. add-long/2addr v0, v2
  310. invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
  311. goto :goto_0
  312. :cond_0
  313. return-wide v0
  314. :cond_1
  315. new-instance p1, Ljava/lang/IllegalArgumentException;
  316. const-string v0, "source == null"
  317. invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  318. goto :goto_2
  319. :goto_1
  320. throw p1
  321. :goto_2
  322. goto :goto_1
  323. .end method
  324. .method public writeByte(I)Lokio/BufferedSink;
  325. .locals 1
  326. .annotation system Ldalvik/annotation/Throws;
  327. value = {
  328. Ljava/io/IOException;
  329. }
  330. .end annotation
  331. iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
  332. if-nez v0, :cond_0
  333. iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  334. invoke-virtual {v0, p1}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
  335. invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
  336. move-result-object p1
  337. return-object p1
  338. :cond_0
  339. new-instance p1, Ljava/lang/IllegalStateException;
  340. const-string v0, "closed"
  341. invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  342. throw p1
  343. .end method
  344. .method public writeDecimalLong(J)Lokio/BufferedSink;
  345. .locals 1
  346. .annotation system Ldalvik/annotation/Throws;
  347. value = {
  348. Ljava/io/IOException;
  349. }
  350. .end annotation
  351. iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
  352. if-nez v0, :cond_0
  353. iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  354. invoke-virtual {v0, p1, p2}, Lokio/Buffer;->writeDecimalLong(J)Lokio/Buffer;
  355. invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
  356. move-result-object p1
  357. return-object p1
  358. :cond_0
  359. new-instance p1, Ljava/lang/IllegalStateException;
  360. const-string p2, "closed"
  361. invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  362. throw p1
  363. .end method
  364. .method public writeHexadecimalUnsignedLong(J)Lokio/BufferedSink;
  365. .locals 1
  366. .annotation system Ldalvik/annotation/Throws;
  367. value = {
  368. Ljava/io/IOException;
  369. }
  370. .end annotation
  371. iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
  372. if-nez v0, :cond_0
  373. iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  374. invoke-virtual {v0, p1, p2}, Lokio/Buffer;->writeHexadecimalUnsignedLong(J)Lokio/Buffer;
  375. invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
  376. move-result-object p1
  377. return-object p1
  378. :cond_0
  379. new-instance p1, Ljava/lang/IllegalStateException;
  380. const-string p2, "closed"
  381. invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  382. throw p1
  383. .end method
  384. .method public writeInt(I)Lokio/BufferedSink;
  385. .locals 1
  386. .annotation system Ldalvik/annotation/Throws;
  387. value = {
  388. Ljava/io/IOException;
  389. }
  390. .end annotation
  391. iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
  392. if-nez v0, :cond_0
  393. iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  394. invoke-virtual {v0, p1}, Lokio/Buffer;->writeInt(I)Lokio/Buffer;
  395. invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
  396. move-result-object p1
  397. return-object p1
  398. :cond_0
  399. new-instance p1, Ljava/lang/IllegalStateException;
  400. const-string v0, "closed"
  401. invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  402. throw p1
  403. .end method
  404. .method public writeIntLe(I)Lokio/BufferedSink;
  405. .locals 1
  406. .annotation system Ldalvik/annotation/Throws;
  407. value = {
  408. Ljava/io/IOException;
  409. }
  410. .end annotation
  411. iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
  412. if-nez v0, :cond_0
  413. iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  414. invoke-virtual {v0, p1}, Lokio/Buffer;->writeIntLe(I)Lokio/Buffer;
  415. invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
  416. move-result-object p1
  417. return-object p1
  418. :cond_0
  419. new-instance p1, Ljava/lang/IllegalStateException;
  420. const-string v0, "closed"
  421. invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  422. throw p1
  423. .end method
  424. .method public writeLong(J)Lokio/BufferedSink;
  425. .locals 1
  426. .annotation system Ldalvik/annotation/Throws;
  427. value = {
  428. Ljava/io/IOException;
  429. }
  430. .end annotation
  431. iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
  432. if-nez v0, :cond_0
  433. iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  434. invoke-virtual {v0, p1, p2}, Lokio/Buffer;->writeLong(J)Lokio/Buffer;
  435. invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
  436. move-result-object p1
  437. return-object p1
  438. :cond_0
  439. new-instance p1, Ljava/lang/IllegalStateException;
  440. const-string p2, "closed"
  441. invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  442. throw p1
  443. .end method
  444. .method public writeLongLe(J)Lokio/BufferedSink;
  445. .locals 1
  446. .annotation system Ldalvik/annotation/Throws;
  447. value = {
  448. Ljava/io/IOException;
  449. }
  450. .end annotation
  451. iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
  452. if-nez v0, :cond_0
  453. iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  454. invoke-virtual {v0, p1, p2}, Lokio/Buffer;->writeLongLe(J)Lokio/Buffer;
  455. invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
  456. move-result-object p1
  457. return-object p1
  458. :cond_0
  459. new-instance p1, Ljava/lang/IllegalStateException;
  460. const-string p2, "closed"
  461. invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  462. throw p1
  463. .end method
  464. .method public writeShort(I)Lokio/BufferedSink;
  465. .locals 1
  466. .annotation system Ldalvik/annotation/Throws;
  467. value = {
  468. Ljava/io/IOException;
  469. }
  470. .end annotation
  471. iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
  472. if-nez v0, :cond_0
  473. iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  474. invoke-virtual {v0, p1}, Lokio/Buffer;->writeShort(I)Lokio/Buffer;
  475. invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
  476. move-result-object p1
  477. return-object p1
  478. :cond_0
  479. new-instance p1, Ljava/lang/IllegalStateException;
  480. const-string v0, "closed"
  481. invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  482. throw p1
  483. .end method
  484. .method public writeShortLe(I)Lokio/BufferedSink;
  485. .locals 1
  486. .annotation system Ldalvik/annotation/Throws;
  487. value = {
  488. Ljava/io/IOException;
  489. }
  490. .end annotation
  491. iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
  492. if-nez v0, :cond_0
  493. iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  494. invoke-virtual {v0, p1}, Lokio/Buffer;->writeShortLe(I)Lokio/Buffer;
  495. invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
  496. move-result-object p1
  497. return-object p1
  498. :cond_0
  499. new-instance p1, Ljava/lang/IllegalStateException;
  500. const-string v0, "closed"
  501. invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  502. throw p1
  503. .end method
  504. .method public writeString(Ljava/lang/String;IILjava/nio/charset/Charset;)Lokio/BufferedSink;
  505. .locals 1
  506. .annotation system Ldalvik/annotation/Throws;
  507. value = {
  508. Ljava/io/IOException;
  509. }
  510. .end annotation
  511. iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
  512. if-nez v0, :cond_0
  513. iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  514. invoke-virtual {v0, p1, p2, p3, p4}, Lokio/Buffer;->writeString(Ljava/lang/String;IILjava/nio/charset/Charset;)Lokio/Buffer;
  515. invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
  516. move-result-object p1
  517. return-object p1
  518. :cond_0
  519. new-instance p1, Ljava/lang/IllegalStateException;
  520. const-string p2, "closed"
  521. invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  522. throw p1
  523. .end method
  524. .method public writeString(Ljava/lang/String;Ljava/nio/charset/Charset;)Lokio/BufferedSink;
  525. .locals 1
  526. .annotation system Ldalvik/annotation/Throws;
  527. value = {
  528. Ljava/io/IOException;
  529. }
  530. .end annotation
  531. iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
  532. if-nez v0, :cond_0
  533. iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  534. invoke-virtual {v0, p1, p2}, Lokio/Buffer;->writeString(Ljava/lang/String;Ljava/nio/charset/Charset;)Lokio/Buffer;
  535. invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
  536. move-result-object p1
  537. return-object p1
  538. :cond_0
  539. new-instance p1, Ljava/lang/IllegalStateException;
  540. const-string p2, "closed"
  541. invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  542. throw p1
  543. .end method
  544. .method public writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
  545. .locals 1
  546. .annotation system Ldalvik/annotation/Throws;
  547. value = {
  548. Ljava/io/IOException;
  549. }
  550. .end annotation
  551. iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
  552. if-nez v0, :cond_0
  553. iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  554. invoke-virtual {v0, p1}, Lokio/Buffer;->writeUtf8(Ljava/lang/String;)Lokio/Buffer;
  555. invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
  556. move-result-object p1
  557. return-object p1
  558. :cond_0
  559. new-instance p1, Ljava/lang/IllegalStateException;
  560. const-string v0, "closed"
  561. invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  562. throw p1
  563. .end method
  564. .method public writeUtf8(Ljava/lang/String;II)Lokio/BufferedSink;
  565. .locals 1
  566. .annotation system Ldalvik/annotation/Throws;
  567. value = {
  568. Ljava/io/IOException;
  569. }
  570. .end annotation
  571. iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
  572. if-nez v0, :cond_0
  573. iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  574. invoke-virtual {v0, p1, p2, p3}, Lokio/Buffer;->writeUtf8(Ljava/lang/String;II)Lokio/Buffer;
  575. invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
  576. move-result-object p1
  577. return-object p1
  578. :cond_0
  579. new-instance p1, Ljava/lang/IllegalStateException;
  580. const-string p2, "closed"
  581. invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  582. throw p1
  583. .end method
  584. .method public writeUtf8CodePoint(I)Lokio/BufferedSink;
  585. .locals 1
  586. .annotation system Ldalvik/annotation/Throws;
  587. value = {
  588. Ljava/io/IOException;
  589. }
  590. .end annotation
  591. iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
  592. if-nez v0, :cond_0
  593. iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  594. invoke-virtual {v0, p1}, Lokio/Buffer;->writeUtf8CodePoint(I)Lokio/Buffer;
  595. invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
  596. move-result-object p1
  597. return-object p1
  598. :cond_0
  599. new-instance p1, Ljava/lang/IllegalStateException;
  600. const-string v0, "closed"
  601. invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  602. throw p1
  603. .end method