123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433 |
- .class public final Lokio/Okio;
- .super Ljava/lang/Object;
- .source ""
- # static fields
- .field static final logger:Ljava/util/logging/Logger;
- # direct methods
- .method static constructor <clinit>()V
- .locals 1
- const-class v0, Lokio/Okio;
- invoke-virtual {v0}, Ljava/lang/Class;->getName()Ljava/lang/String;
- move-result-object v0
- invoke-static {v0}, Ljava/util/logging/Logger;->getLogger(Ljava/lang/String;)Ljava/util/logging/Logger;
- move-result-object v0
- sput-object v0, Lokio/Okio;->logger:Ljava/util/logging/Logger;
- return-void
- .end method
- .method private constructor <init>()V
- .locals 0
- invoke-direct {p0}, Ljava/lang/Object;-><init>()V
- return-void
- .end method
- .method public static appendingSink(Ljava/io/File;)Lokio/Sink;
- .locals 2
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/FileNotFoundException;
- }
- .end annotation
- if-eqz p0, :cond_0
- new-instance v0, Ljava/io/FileOutputStream;
- const/4 v1, 0x1
- invoke-direct {v0, p0, v1}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;Z)V
- invoke-static {v0}, Lokio/Okio;->sink(Ljava/io/OutputStream;)Lokio/Sink;
- move-result-object p0
- return-object p0
- :cond_0
- new-instance p0, Ljava/lang/IllegalArgumentException;
- const-string v0, "file == null"
- invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
- throw p0
- .end method
- .method public static blackhole()Lokio/Sink;
- .locals 1
- new-instance v0, Lokio/Okio$3;
- invoke-direct {v0}, Lokio/Okio$3;-><init>()V
- return-object v0
- .end method
- .method public static buffer(Lokio/Sink;)Lokio/BufferedSink;
- .locals 1
- new-instance v0, Lokio/RealBufferedSink;
- invoke-direct {v0, p0}, Lokio/RealBufferedSink;-><init>(Lokio/Sink;)V
- return-object v0
- .end method
- .method public static buffer(Lokio/Source;)Lokio/BufferedSource;
- .locals 1
- new-instance v0, Lokio/RealBufferedSource;
- invoke-direct {v0, p0}, Lokio/RealBufferedSource;-><init>(Lokio/Source;)V
- return-object v0
- .end method
- .method static isAndroidGetsocknameError(Ljava/lang/AssertionError;)Z
- .locals 1
- invoke-virtual {p0}, Ljava/lang/AssertionError;->getCause()Ljava/lang/Throwable;
- move-result-object v0
- if-eqz v0, :cond_0
- invoke-virtual {p0}, Ljava/lang/AssertionError;->getMessage()Ljava/lang/String;
- move-result-object v0
- if-eqz v0, :cond_0
- invoke-virtual {p0}, Ljava/lang/AssertionError;->getMessage()Ljava/lang/String;
- move-result-object p0
- const-string v0, "getsockname failed"
- invoke-virtual {p0, v0}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
- move-result p0
- if-eqz p0, :cond_0
- const/4 p0, 0x1
- goto :goto_0
- :cond_0
- const/4 p0, 0x0
- :goto_0
- return p0
- .end method
- .method public static sink(Ljava/io/File;)Lokio/Sink;
- .locals 1
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/FileNotFoundException;
- }
- .end annotation
- if-eqz p0, :cond_0
- new-instance v0, Ljava/io/FileOutputStream;
- invoke-direct {v0, p0}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V
- invoke-static {v0}, Lokio/Okio;->sink(Ljava/io/OutputStream;)Lokio/Sink;
- move-result-object p0
- return-object p0
- :cond_0
- new-instance p0, Ljava/lang/IllegalArgumentException;
- const-string v0, "file == null"
- invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
- throw p0
- .end method
- .method public static sink(Ljava/io/OutputStream;)Lokio/Sink;
- .locals 1
- new-instance v0, Lokio/Timeout;
- invoke-direct {v0}, Lokio/Timeout;-><init>()V
- invoke-static {p0, v0}, Lokio/Okio;->sink(Ljava/io/OutputStream;Lokio/Timeout;)Lokio/Sink;
- move-result-object p0
- return-object p0
- .end method
- .method private static sink(Ljava/io/OutputStream;Lokio/Timeout;)Lokio/Sink;
- .locals 1
- if-eqz p0, :cond_1
- if-eqz p1, :cond_0
- new-instance v0, Lokio/Okio$1;
- invoke-direct {v0, p1, p0}, Lokio/Okio$1;-><init>(Lokio/Timeout;Ljava/io/OutputStream;)V
- return-object v0
- :cond_0
- new-instance p0, Ljava/lang/IllegalArgumentException;
- const-string p1, "timeout == null"
- invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
- throw p0
- :cond_1
- new-instance p0, Ljava/lang/IllegalArgumentException;
- const-string p1, "out == null"
- invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
- throw p0
- .end method
- .method public static sink(Ljava/net/Socket;)Lokio/Sink;
- .locals 1
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- if-eqz p0, :cond_0
- invoke-static {p0}, Lokio/Okio;->timeout(Ljava/net/Socket;)Lokio/AsyncTimeout;
- move-result-object v0
- invoke-virtual {p0}, Ljava/net/Socket;->getOutputStream()Ljava/io/OutputStream;
- move-result-object p0
- invoke-static {p0, v0}, Lokio/Okio;->sink(Ljava/io/OutputStream;Lokio/Timeout;)Lokio/Sink;
- move-result-object p0
- invoke-virtual {v0, p0}, Lokio/AsyncTimeout;->sink(Lokio/Sink;)Lokio/Sink;
- move-result-object p0
- return-object p0
- :cond_0
- new-instance p0, Ljava/lang/IllegalArgumentException;
- const-string v0, "socket == null"
- invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
- throw p0
- .end method
- .method public static varargs sink(Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Lokio/Sink;
- .locals 0
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- if-eqz p0, :cond_0
- invoke-static {p0, p1}, Ljava/nio/file/Files;->newOutputStream(Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Ljava/io/OutputStream;
- move-result-object p0
- invoke-static {p0}, Lokio/Okio;->sink(Ljava/io/OutputStream;)Lokio/Sink;
- move-result-object p0
- return-object p0
- :cond_0
- new-instance p0, Ljava/lang/IllegalArgumentException;
- const-string p1, "path == null"
- invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
- throw p0
- .end method
- .method public static source(Ljava/io/File;)Lokio/Source;
- .locals 1
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/FileNotFoundException;
- }
- .end annotation
- if-eqz p0, :cond_0
- new-instance v0, Ljava/io/FileInputStream;
- invoke-direct {v0, p0}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V
- invoke-static {v0}, Lokio/Okio;->source(Ljava/io/InputStream;)Lokio/Source;
- move-result-object p0
- return-object p0
- :cond_0
- new-instance p0, Ljava/lang/IllegalArgumentException;
- const-string v0, "file == null"
- invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
- throw p0
- .end method
- .method public static source(Ljava/io/InputStream;)Lokio/Source;
- .locals 1
- new-instance v0, Lokio/Timeout;
- invoke-direct {v0}, Lokio/Timeout;-><init>()V
- invoke-static {p0, v0}, Lokio/Okio;->source(Ljava/io/InputStream;Lokio/Timeout;)Lokio/Source;
- move-result-object p0
- return-object p0
- .end method
- .method private static source(Ljava/io/InputStream;Lokio/Timeout;)Lokio/Source;
- .locals 1
- if-eqz p0, :cond_1
- if-eqz p1, :cond_0
- new-instance v0, Lokio/Okio$2;
- invoke-direct {v0, p1, p0}, Lokio/Okio$2;-><init>(Lokio/Timeout;Ljava/io/InputStream;)V
- return-object v0
- :cond_0
- new-instance p0, Ljava/lang/IllegalArgumentException;
- const-string p1, "timeout == null"
- invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
- throw p0
- :cond_1
- new-instance p0, Ljava/lang/IllegalArgumentException;
- const-string p1, "in == null"
- invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
- throw p0
- .end method
- .method public static source(Ljava/net/Socket;)Lokio/Source;
- .locals 1
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- if-eqz p0, :cond_0
- invoke-static {p0}, Lokio/Okio;->timeout(Ljava/net/Socket;)Lokio/AsyncTimeout;
- move-result-object v0
- invoke-virtual {p0}, Ljava/net/Socket;->getInputStream()Ljava/io/InputStream;
- move-result-object p0
- invoke-static {p0, v0}, Lokio/Okio;->source(Ljava/io/InputStream;Lokio/Timeout;)Lokio/Source;
- move-result-object p0
- invoke-virtual {v0, p0}, Lokio/AsyncTimeout;->source(Lokio/Source;)Lokio/Source;
- move-result-object p0
- return-object p0
- :cond_0
- new-instance p0, Ljava/lang/IllegalArgumentException;
- const-string v0, "socket == null"
- invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
- throw p0
- .end method
- .method public static varargs source(Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Lokio/Source;
- .locals 0
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- if-eqz p0, :cond_0
- invoke-static {p0, p1}, Ljava/nio/file/Files;->newInputStream(Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Ljava/io/InputStream;
- move-result-object p0
- invoke-static {p0}, Lokio/Okio;->source(Ljava/io/InputStream;)Lokio/Source;
- move-result-object p0
- return-object p0
- :cond_0
- new-instance p0, Ljava/lang/IllegalArgumentException;
- const-string p1, "path == null"
- invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
- throw p0
- .end method
- .method private static timeout(Ljava/net/Socket;)Lokio/AsyncTimeout;
- .locals 1
- new-instance v0, Lokio/Okio$4;
- invoke-direct {v0, p0}, Lokio/Okio$4;-><init>(Ljava/net/Socket;)V
- return-object v0
- .end method
|