.class Lokhttp3/internal/cache2/Relay$RelaySource; .super Ljava/lang/Object; .source "Relay.java" # interfaces .implements Lokio/Source; # annotations .annotation system Ldalvik/annotation/EnclosingClass; value = Lokhttp3/internal/cache2/Relay; .end annotation .annotation system Ldalvik/annotation/InnerClass; accessFlags = 0x0 name = "RelaySource" .end annotation # instance fields .field final synthetic a:Lokhttp3/internal/cache2/Relay; .field private final b:Lokio/Timeout; .field private c:Lokhttp3/internal/cache2/FileOperator; .field private d:J # virtual methods .method public close()V .locals 4 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 344 iget-object v0, p0, Lokhttp3/internal/cache2/Relay$RelaySource;->c:Lokhttp3/internal/cache2/FileOperator; if-nez v0, :cond_0 return-void :cond_0 const/4 v0, 0x0 .line 345 iput-object v0, p0, Lokhttp3/internal/cache2/Relay$RelaySource;->c:Lokhttp3/internal/cache2/FileOperator; .line 348 iget-object v1, p0, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; monitor-enter v1 .line 349 :try_start_0 iget-object v2, p0, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; iget v3, v2, Lokhttp3/internal/cache2/Relay;->k:I add-int/lit8 v3, v3, -0x1 iput v3, v2, Lokhttp3/internal/cache2/Relay;->k:I .line 350 iget-object v2, p0, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; iget v2, v2, Lokhttp3/internal/cache2/Relay;->k:I if-nez v2, :cond_1 .line 351 iget-object v2, p0, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; iget-object v2, v2, Lokhttp3/internal/cache2/Relay;->c:Ljava/io/RandomAccessFile; .line 352 iget-object v3, p0, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; iput-object v0, v3, Lokhttp3/internal/cache2/Relay;->c:Ljava/io/RandomAccessFile; move-object v0, v2 .line 354 :cond_1 monitor-exit v1 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 if-eqz v0, :cond_2 .line 357 invoke-static {v0}, Lokhttp3/internal/Util;->a(Ljava/io/Closeable;)V :cond_2 return-void :catchall_0 move-exception v0 .line 354 :try_start_1 monitor-exit v1 :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 throw v0 .end method .method public read(Lokio/Buffer;J)J .locals 21 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation move-object/from16 v1, p0 move-wide/from16 v2, p2 .line 252 iget-object v0, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->c:Lokhttp3/internal/cache2/FileOperator; if-eqz v0, :cond_7 .line 258 iget-object v4, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; monitor-enter v4 .line 260 :goto_0 :try_start_0 iget-wide v5, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->d:J iget-object v0, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; iget-wide v7, v0, Lokhttp3/internal/cache2/Relay;->g:J const/4 v0, 0x2 const-wide/16 v9, -0x1 cmp-long v11, v5, v7 if-nez v11, :cond_2 .line 262 iget-object v5, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; iget-boolean v5, v5, Lokhttp3/internal/cache2/Relay;->h:Z if-eqz v5, :cond_0 monitor-exit v4 return-wide v9 .line 265 :cond_0 iget-object v5, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; iget-object v5, v5, Lokhttp3/internal/cache2/Relay;->d:Ljava/lang/Thread; if-eqz v5, :cond_1 .line 266 iget-object v0, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->b:Lokio/Timeout; iget-object v5, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; invoke-virtual {v0, v5}, Lokio/Timeout;->waitUntilNotified(Ljava/lang/Object;)V goto :goto_0 .line 271 :cond_1 iget-object v5, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread; move-result-object v6 iput-object v6, v5, Lokhttp3/internal/cache2/Relay;->d:Ljava/lang/Thread; const/4 v5, 0x1 .line 273 monitor-exit v4 goto :goto_1 .line 276 :cond_2 iget-object v5, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; iget-object v5, v5, Lokhttp3/internal/cache2/Relay;->i:Lokio/Buffer; invoke-virtual {v5}, Lokio/Buffer;->size()J move-result-wide v5 const/4 v11, 0x0 sub-long v5, v7, v5 .line 279 iget-wide v11, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->d:J cmp-long v13, v11, v5 if-gez v13, :cond_6 .line 281 monitor-exit v4 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_5 const/4 v5, 0x2 :goto_1 const-wide/16 v11, 0x20 if-ne v5, v0, :cond_3 .line 293 iget-wide v4, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->d:J sub-long/2addr v7, v4 invoke-static {v2, v3, v7, v8}, Ljava/lang/Math;->min(JJ)J move-result-wide v2 .line 294 iget-object v13, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->c:Lokhttp3/internal/cache2/FileOperator; iget-wide v4, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->d:J add-long v14, v4, v11 move-object/from16 v16, p1 move-wide/from16 v17, v2 invoke-virtual/range {v13 .. v18}, Lokhttp3/internal/cache2/FileOperator;->b(JLokio/Buffer;J)V .line 295 iget-wide v4, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->d:J add-long/2addr v4, v2 iput-wide v4, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->d:J return-wide v2 :cond_3 const/4 v4, 0x0 .line 302 :try_start_1 iget-object v0, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; iget-object v0, v0, Lokhttp3/internal/cache2/Relay;->e:Lokio/Source; iget-object v5, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; iget-object v5, v5, Lokhttp3/internal/cache2/Relay;->f:Lokio/Buffer; iget-object v6, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; iget-wide v13, v6, Lokhttp3/internal/cache2/Relay;->j:J invoke-interface {v0, v5, v13, v14}, Lokio/Source;->read(Lokio/Buffer;J)J move-result-wide v5 cmp-long v0, v5, v9 if-nez v0, :cond_4 .line 306 iget-object v0, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; invoke-virtual {v0, v7, v8}, Lokhttp3/internal/cache2/Relay;->a(J)V :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_3 .line 332 iget-object v2, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; monitor-enter v2 .line 333 :try_start_2 iget-object v0, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; iput-object v4, v0, Lokhttp3/internal/cache2/Relay;->d:Ljava/lang/Thread; .line 334 iget-object v0, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; invoke-virtual {v0}, Ljava/lang/Object;->notifyAll()V .line 335 monitor-exit v2 return-wide v9 :catchall_0 move-exception v0 monitor-exit v2 :try_end_2 .catchall {:try_start_2 .. :try_end_2} :catchall_0 throw v0 .line 311 :cond_4 :try_start_3 invoke-static {v5, v6, v2, v3}, Ljava/lang/Math;->min(JJ)J move-result-wide v2 .line 312 iget-object v0, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; iget-object v13, v0, Lokhttp3/internal/cache2/Relay;->f:Lokio/Buffer; const-wide/16 v15, 0x0 move-object/from16 v14, p1 move-wide/from16 v17, v2 invoke-virtual/range {v13 .. v18}, Lokio/Buffer;->copyTo(Lokio/Buffer;JJ)Lokio/Buffer; .line 313 iget-wide v9, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->d:J const/4 v0, 0x0 add-long/2addr v9, v2 iput-wide v9, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->d:J .line 316 iget-object v15, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->c:Lokhttp3/internal/cache2/FileOperator; const/4 v0, 0x0 add-long v16, v7, v11 iget-object v0, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; iget-object v0, v0, Lokhttp3/internal/cache2/Relay;->f:Lokio/Buffer; .line 317 invoke-virtual {v0}, Lokio/Buffer;->clone()Lokio/Buffer; move-result-object v18 move-wide/from16 v19, v5 .line 316 invoke-virtual/range {v15 .. v20}, Lokhttp3/internal/cache2/FileOperator;->a(JLokio/Buffer;J)V .line 319 iget-object v7, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; monitor-enter v7 :try_end_3 .catchall {:try_start_3 .. :try_end_3} :catchall_3 .line 321 :try_start_4 iget-object v0, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; iget-object v0, v0, Lokhttp3/internal/cache2/Relay;->i:Lokio/Buffer; iget-object v8, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; iget-object v8, v8, Lokhttp3/internal/cache2/Relay;->f:Lokio/Buffer; invoke-virtual {v0, v8, v5, v6}, Lokio/Buffer;->write(Lokio/Buffer;J)V .line 322 iget-object v0, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; iget-object v0, v0, Lokhttp3/internal/cache2/Relay;->i:Lokio/Buffer; invoke-virtual {v0}, Lokio/Buffer;->size()J move-result-wide v8 iget-object v0, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; iget-wide v10, v0, Lokhttp3/internal/cache2/Relay;->j:J cmp-long v0, v8, v10 if-lez v0, :cond_5 .line 323 iget-object v0, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; iget-object v0, v0, Lokhttp3/internal/cache2/Relay;->i:Lokio/Buffer; iget-object v8, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; iget-object v8, v8, Lokhttp3/internal/cache2/Relay;->i:Lokio/Buffer; invoke-virtual {v8}, Lokio/Buffer;->size()J move-result-wide v8 iget-object v10, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; iget-wide v10, v10, Lokhttp3/internal/cache2/Relay;->j:J const/4 v12, 0x0 sub-long/2addr v8, v10 invoke-virtual {v0, v8, v9}, Lokio/Buffer;->skip(J)V .line 327 :cond_5 iget-object v0, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; iget-wide v8, v0, Lokhttp3/internal/cache2/Relay;->g:J const/4 v10, 0x0 add-long/2addr v8, v5 iput-wide v8, v0, Lokhttp3/internal/cache2/Relay;->g:J .line 328 monitor-exit v7 :try_end_4 .catchall {:try_start_4 .. :try_end_4} :catchall_2 .line 332 iget-object v5, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; monitor-enter v5 .line 333 :try_start_5 iget-object v0, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; iput-object v4, v0, Lokhttp3/internal/cache2/Relay;->d:Ljava/lang/Thread; .line 334 iget-object v0, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; invoke-virtual {v0}, Ljava/lang/Object;->notifyAll()V .line 335 monitor-exit v5 return-wide v2 :catchall_1 move-exception v0 monitor-exit v5 :try_end_5 .catchall {:try_start_5 .. :try_end_5} :catchall_1 throw v0 :catchall_2 move-exception v0 .line 328 :try_start_6 monitor-exit v7 :try_end_6 .catchall {:try_start_6 .. :try_end_6} :catchall_2 :try_start_7 throw v0 :try_end_7 .catchall {:try_start_7 .. :try_end_7} :catchall_3 :catchall_3 move-exception v0 .line 332 iget-object v2, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; monitor-enter v2 .line 333 :try_start_8 iget-object v3, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; iput-object v4, v3, Lokhttp3/internal/cache2/Relay;->d:Ljava/lang/Thread; .line 334 iget-object v3, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; invoke-virtual {v3}, Ljava/lang/Object;->notifyAll()V .line 335 monitor-exit v2 :try_end_8 .catchall {:try_start_8 .. :try_end_8} :catchall_4 throw v0 :catchall_4 move-exception v0 :try_start_9 monitor-exit v2 :try_end_9 .catchall {:try_start_9 .. :try_end_9} :catchall_4 throw v0 .line 285 :cond_6 :try_start_a iget-wide v9, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->d:J const/4 v0, 0x0 sub-long/2addr v7, v9 invoke-static {v2, v3, v7, v8}, Ljava/lang/Math;->min(JJ)J move-result-wide v2 .line 286 iget-object v0, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->a:Lokhttp3/internal/cache2/Relay; iget-object v9, v0, Lokhttp3/internal/cache2/Relay;->i:Lokio/Buffer; iget-wide v7, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->d:J const/4 v0, 0x0 sub-long v11, v7, v5 move-object/from16 v10, p1 move-wide v13, v2 invoke-virtual/range {v9 .. v14}, Lokio/Buffer;->copyTo(Lokio/Buffer;JJ)Lokio/Buffer; .line 287 iget-wide v5, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->d:J const/4 v0, 0x0 add-long/2addr v5, v2 iput-wide v5, v1, Lokhttp3/internal/cache2/Relay$RelaySource;->d:J .line 288 monitor-exit v4 return-wide v2 :catchall_5 move-exception v0 .line 289 monitor-exit v4 :try_end_a .catchall {:try_start_a .. :try_end_a} :catchall_5 throw v0 .line 252 :cond_7 new-instance v0, Ljava/lang/IllegalStateException; const-string v2, "closed" invoke-direct {v0, v2}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw v0 .end method .method public timeout()Lokio/Timeout; .locals 1 .line 340 iget-object v0, p0, Lokhttp3/internal/cache2/Relay$RelaySource;->b:Lokio/Timeout; return-object v0 .end method