123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379 |
- .class final Lokhttp3/internal/cache/DiskLruCache$Entry;
- .super Ljava/lang/Object;
- .source ""
- # annotations
- .annotation system Ldalvik/annotation/EnclosingClass;
- value = Lokhttp3/internal/cache/DiskLruCache;
- .end annotation
- .annotation system Ldalvik/annotation/InnerClass;
- accessFlags = 0x12
- name = "Entry"
- .end annotation
- # instance fields
- .field final cleanFiles:[Ljava/io/File;
- .field currentEditor:Lokhttp3/internal/cache/DiskLruCache$Editor;
- .field final dirtyFiles:[Ljava/io/File;
- .field final key:Ljava/lang/String;
- .field final lengths:[J
- .field readable:Z
- .field sequenceNumber:J
- .field final synthetic this$0:Lokhttp3/internal/cache/DiskLruCache;
- # direct methods
- .method constructor <init>(Lokhttp3/internal/cache/DiskLruCache;Ljava/lang/String;)V
- .locals 6
- iput-object p1, p0, Lokhttp3/internal/cache/DiskLruCache$Entry;->this$0:Lokhttp3/internal/cache/DiskLruCache;
- invoke-direct {p0}, Ljava/lang/Object;-><init>()V
- iput-object p2, p0, Lokhttp3/internal/cache/DiskLruCache$Entry;->key:Ljava/lang/String;
- iget v0, p1, Lokhttp3/internal/cache/DiskLruCache;->valueCount:I
- new-array v1, v0, [J
- iput-object v1, p0, Lokhttp3/internal/cache/DiskLruCache$Entry;->lengths:[J
- new-array v1, v0, [Ljava/io/File;
- iput-object v1, p0, Lokhttp3/internal/cache/DiskLruCache$Entry;->cleanFiles:[Ljava/io/File;
- new-array v0, v0, [Ljava/io/File;
- iput-object v0, p0, Lokhttp3/internal/cache/DiskLruCache$Entry;->dirtyFiles:[Ljava/io/File;
- new-instance v0, Ljava/lang/StringBuilder;
- invoke-direct {v0, p2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
- const/16 p2, 0x2e
- invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
- invoke-virtual {v0}, Ljava/lang/StringBuilder;->length()I
- move-result p2
- const/4 v1, 0x0
- :goto_0
- iget v2, p1, Lokhttp3/internal/cache/DiskLruCache;->valueCount:I
- if-ge v1, v2, :cond_0
- invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
- iget-object v2, p0, Lokhttp3/internal/cache/DiskLruCache$Entry;->cleanFiles:[Ljava/io/File;
- new-instance v3, Ljava/io/File;
- iget-object v4, p1, Lokhttp3/internal/cache/DiskLruCache;->directory:Ljava/io/File;
- invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object v5
- invoke-direct {v3, v4, v5}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V
- aput-object v3, v2, v1
- const-string v2, ".tmp"
- invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- iget-object v2, p0, Lokhttp3/internal/cache/DiskLruCache$Entry;->dirtyFiles:[Ljava/io/File;
- new-instance v3, Ljava/io/File;
- iget-object v4, p1, Lokhttp3/internal/cache/DiskLruCache;->directory:Ljava/io/File;
- invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object v5
- invoke-direct {v3, v4, v5}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V
- aput-object v3, v2, v1
- invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->setLength(I)V
- add-int/lit8 v1, v1, 0x1
- goto :goto_0
- :cond_0
- return-void
- .end method
- .method private invalidLengths([Ljava/lang/String;)Ljava/io/IOException;
- .locals 3
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- new-instance v0, Ljava/io/IOException;
- new-instance v1, Ljava/lang/StringBuilder;
- invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
- const-string v2, "unexpected journal line: "
- invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-static {p1}, Ljava/util/Arrays;->toString([Ljava/lang/Object;)Ljava/lang/String;
- move-result-object p1
- invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object p1
- invoke-direct {v0, p1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
- throw v0
- .end method
- # virtual methods
- .method setLengths([Ljava/lang/String;)V
- .locals 4
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- array-length v0, p1
- iget-object v1, p0, Lokhttp3/internal/cache/DiskLruCache$Entry;->this$0:Lokhttp3/internal/cache/DiskLruCache;
- iget v1, v1, Lokhttp3/internal/cache/DiskLruCache;->valueCount:I
- if-ne v0, v1, :cond_1
- const/4 v0, 0x0
- :goto_0
- :try_start_0
- array-length v1, p1
- if-ge v0, v1, :cond_0
- iget-object v1, p0, Lokhttp3/internal/cache/DiskLruCache$Entry;->lengths:[J
- aget-object v2, p1, v0
- invoke-static {v2}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
- move-result-wide v2
- aput-wide v2, v1, v0
- :try_end_0
- .catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0
- add-int/lit8 v0, v0, 0x1
- goto :goto_0
- :cond_0
- return-void
- :catch_0
- invoke-direct {p0, p1}, Lokhttp3/internal/cache/DiskLruCache$Entry;->invalidLengths([Ljava/lang/String;)Ljava/io/IOException;
- move-result-object p1
- throw p1
- :cond_1
- invoke-direct {p0, p1}, Lokhttp3/internal/cache/DiskLruCache$Entry;->invalidLengths([Ljava/lang/String;)Ljava/io/IOException;
- move-result-object p1
- goto :goto_2
- :goto_1
- throw p1
- :goto_2
- goto :goto_1
- .end method
- .method snapshot()Lokhttp3/internal/cache/DiskLruCache$Snapshot;
- .locals 10
- iget-object v0, p0, Lokhttp3/internal/cache/DiskLruCache$Entry;->this$0:Lokhttp3/internal/cache/DiskLruCache;
- invoke-static {v0}, Ljava/lang/Thread;->holdsLock(Ljava/lang/Object;)Z
- move-result v0
- if-eqz v0, :cond_2
- iget-object v0, p0, Lokhttp3/internal/cache/DiskLruCache$Entry;->this$0:Lokhttp3/internal/cache/DiskLruCache;
- iget v0, v0, Lokhttp3/internal/cache/DiskLruCache;->valueCount:I
- new-array v0, v0, [Lokio/Source;
- iget-object v1, p0, Lokhttp3/internal/cache/DiskLruCache$Entry;->lengths:[J
- invoke-virtual {v1}, [J->clone()Ljava/lang/Object;
- move-result-object v1
- move-object v7, v1
- check-cast v7, [J
- const/4 v8, 0x0
- const/4 v1, 0x0
- :goto_0
- :try_start_0
- iget-object v2, p0, Lokhttp3/internal/cache/DiskLruCache$Entry;->this$0:Lokhttp3/internal/cache/DiskLruCache;
- iget v2, v2, Lokhttp3/internal/cache/DiskLruCache;->valueCount:I
- if-ge v1, v2, :cond_0
- iget-object v2, p0, Lokhttp3/internal/cache/DiskLruCache$Entry;->this$0:Lokhttp3/internal/cache/DiskLruCache;
- iget-object v2, v2, Lokhttp3/internal/cache/DiskLruCache;->fileSystem:Lokhttp3/internal/io/FileSystem;
- iget-object v3, p0, Lokhttp3/internal/cache/DiskLruCache$Entry;->cleanFiles:[Ljava/io/File;
- aget-object v3, v3, v1
- invoke-interface {v2, v3}, Lokhttp3/internal/io/FileSystem;->source(Ljava/io/File;)Lokio/Source;
- move-result-object v2
- aput-object v2, v0, v1
- add-int/lit8 v1, v1, 0x1
- goto :goto_0
- :cond_0
- new-instance v9, Lokhttp3/internal/cache/DiskLruCache$Snapshot;
- iget-object v2, p0, Lokhttp3/internal/cache/DiskLruCache$Entry;->this$0:Lokhttp3/internal/cache/DiskLruCache;
- iget-object v3, p0, Lokhttp3/internal/cache/DiskLruCache$Entry;->key:Ljava/lang/String;
- iget-wide v4, p0, Lokhttp3/internal/cache/DiskLruCache$Entry;->sequenceNumber:J
- move-object v1, v9
- move-object v6, v0
- invoke-direct/range {v1 .. v7}, Lokhttp3/internal/cache/DiskLruCache$Snapshot;-><init>(Lokhttp3/internal/cache/DiskLruCache;Ljava/lang/String;J[Lokio/Source;[J)V
- :try_end_0
- .catch Ljava/io/FileNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
- return-object v9
- :catch_0
- nop
- :goto_1
- iget-object v1, p0, Lokhttp3/internal/cache/DiskLruCache$Entry;->this$0:Lokhttp3/internal/cache/DiskLruCache;
- iget v1, v1, Lokhttp3/internal/cache/DiskLruCache;->valueCount:I
- if-ge v8, v1, :cond_1
- aget-object v1, v0, v8
- if-eqz v1, :cond_1
- aget-object v1, v0, v8
- invoke-static {v1}, Lokhttp3/internal/Util;->closeQuietly(Ljava/io/Closeable;)V
- add-int/lit8 v8, v8, 0x1
- goto :goto_1
- :cond_1
- :try_start_1
- iget-object v0, p0, Lokhttp3/internal/cache/DiskLruCache$Entry;->this$0:Lokhttp3/internal/cache/DiskLruCache;
- invoke-virtual {v0, p0}, Lokhttp3/internal/cache/DiskLruCache;->removeEntry(Lokhttp3/internal/cache/DiskLruCache$Entry;)Z
- :try_end_1
- .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_1
- :catch_1
- const/4 v0, 0x0
- return-object v0
- :cond_2
- new-instance v0, Ljava/lang/AssertionError;
- invoke-direct {v0}, Ljava/lang/AssertionError;-><init>()V
- goto :goto_3
- :goto_2
- throw v0
- :goto_3
- goto :goto_2
- .end method
- .method writeLengths(Lokio/BufferedSink;)V
- .locals 6
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- iget-object v0, p0, Lokhttp3/internal/cache/DiskLruCache$Entry;->lengths:[J
- array-length v1, v0
- const/4 v2, 0x0
- :goto_0
- if-ge v2, v1, :cond_0
- aget-wide v3, v0, v2
- const/16 v5, 0x20
- invoke-interface {p1, v5}, Lokio/BufferedSink;->writeByte(I)Lokio/BufferedSink;
- move-result-object v5
- invoke-interface {v5, v3, v4}, Lokio/BufferedSink;->writeDecimalLong(J)Lokio/BufferedSink;
- add-int/lit8 v2, v2, 0x1
- goto :goto_0
- :cond_0
- return-void
- .end method
|