.class public abstract Lcom/google/common/io/ByteSource; .super Ljava/lang/Object; .source "ByteSource.java" # interfaces .implements Lcom/google/common/io/InputSupplier; # annotations .annotation system Ldalvik/annotation/MemberClasses; value = { Lcom/google/common/io/ByteSource$1;, Lcom/google/common/io/ByteSource$ConcatenatedByteSource;, Lcom/google/common/io/ByteSource$EmptyByteSource;, Lcom/google/common/io/ByteSource$ByteArrayByteSource;, Lcom/google/common/io/ByteSource$SlicedByteSource;, Lcom/google/common/io/ByteSource$AsCharSource; } .end annotation .annotation system Ldalvik/annotation/Signature; value = { "Ljava/lang/Object;", "Lcom/google/common/io/InputSupplier", "<", "Ljava/io/InputStream;", ">;" } .end annotation # static fields .field private static final BUF_SIZE:I = 0x1000 .field private static final countBuffer:[B # direct methods .method static constructor ()V .locals 1 .prologue .line 211 const/16 v0, 0x1000 new-array v0, v0, [B sput-object v0, Lcom/google/common/io/ByteSource;->countBuffer:[B return-void .end method .method protected constructor ()V .locals 0 .prologue .line 66 invoke-direct {p0}, Ljava/lang/Object;->()V return-void .end method .method public static concat(Ljava/lang/Iterable;)Lcom/google/common/io/ByteSource; .locals 1 .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/lang/Iterable", "<+", "Lcom/google/common/io/ByteSource;", ">;)", "Lcom/google/common/io/ByteSource;" } .end annotation .prologue .line 361 new-instance v0, Lcom/google/common/io/ByteSource$ConcatenatedByteSource; invoke-direct {v0, p0}, Lcom/google/common/io/ByteSource$ConcatenatedByteSource;->(Ljava/lang/Iterable;)V return-object v0 .end method .method public static concat(Ljava/util/Iterator;)Lcom/google/common/io/ByteSource; .locals 1 .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/util/Iterator", "<+", "Lcom/google/common/io/ByteSource;", ">;)", "Lcom/google/common/io/ByteSource;" } .end annotation .prologue .line 383 invoke-static {p0}, Lcom/google/common/collect/ImmutableList;->copyOf(Ljava/util/Iterator;)Lcom/google/common/collect/ImmutableList; move-result-object v0 invoke-static {v0}, Lcom/google/common/io/ByteSource;->concat(Ljava/lang/Iterable;)Lcom/google/common/io/ByteSource; move-result-object v0 return-object v0 .end method .method public static varargs concat([Lcom/google/common/io/ByteSource;)Lcom/google/common/io/ByteSource; .locals 1 .prologue .line 399 invoke-static {p0}, Lcom/google/common/collect/ImmutableList;->copyOf([Ljava/lang/Object;)Lcom/google/common/collect/ImmutableList; move-result-object v0 invoke-static {v0}, Lcom/google/common/io/ByteSource;->concat(Ljava/lang/Iterable;)Lcom/google/common/io/ByteSource; move-result-object v0 return-object v0 .end method .method private countByReading(Ljava/io/InputStream;)J .locals 6 .prologue .line 214 const-wide/16 v0, 0x0 .line 216 :goto_0 sget-object v2, Lcom/google/common/io/ByteSource;->countBuffer:[B invoke-virtual {p1, v2}, Ljava/io/InputStream;->read([B)I move-result v2 int-to-long v2, v2 const-wide/16 v4, -0x1 cmp-long v4, v2, v4 if-eqz v4, :cond_0 .line 217 add-long/2addr v0, v2 goto :goto_0 .line 219 :cond_0 return-wide v0 .end method .method private countBySkipping(Ljava/io/InputStream;)J .locals 7 .prologue const-wide/16 v2, 0x0 .line 191 move-wide v0, v2 .line 195 :goto_0 invoke-virtual {p1}, Ljava/io/InputStream;->available()I move-result v4 const v5, 0x7fffffff invoke-static {v4, v5}, Ljava/lang/Math;->min(II)I move-result v4 int-to-long v4, v4 invoke-virtual {p1, v4, v5}, Ljava/io/InputStream;->skip(J)J move-result-wide v4 .line 196 cmp-long v6, v4, v2 if-gtz v6, :cond_2 .line 197 invoke-virtual {p1}, Ljava/io/InputStream;->read()I move-result v4 const/4 v5, -0x1 if-ne v4, v5, :cond_0 .line 198 return-wide v0 .line 199 :cond_0 cmp-long v4, v0, v2 if-nez v4, :cond_1 invoke-virtual {p1}, Ljava/io/InputStream;->available()I move-result v4 if-nez v4, :cond_1 .line 202 new-instance v0, Ljava/io/IOException; invoke-direct {v0}, Ljava/io/IOException;->()V throw v0 .line 204 :cond_1 const-wide/16 v4, 0x1 add-long/2addr v0, v4 goto :goto_0 .line 206 :cond_2 add-long/2addr v0, v4 goto :goto_0 .end method .method public static empty()Lcom/google/common/io/ByteSource; .locals 1 .prologue .line 418 invoke-static {}, Lcom/google/common/io/ByteSource$EmptyByteSource;->access$200()Lcom/google/common/io/ByteSource$EmptyByteSource; move-result-object v0 return-object v0 .end method .method public static wrap([B)Lcom/google/common/io/ByteSource; .locals 1 .prologue .line 409 new-instance v0, Lcom/google/common/io/ByteSource$ByteArrayByteSource; invoke-direct {v0, p0}, Lcom/google/common/io/ByteSource$ByteArrayByteSource;->([B)V return-object v0 .end method # virtual methods .method public asCharSource(Ljava/nio/charset/Charset;)Lcom/google/common/io/CharSource; .locals 2 .prologue .line 73 new-instance v0, Lcom/google/common/io/ByteSource$AsCharSource; const/4 v1, 0x0 invoke-direct {v0, p0, p1, v1}, Lcom/google/common/io/ByteSource$AsCharSource;->(Lcom/google/common/io/ByteSource;Ljava/nio/charset/Charset;Lcom/google/common/io/ByteSource$1;)V return-object v0 .end method .method public contentEquals(Lcom/google/common/io/ByteSource;)Z .locals 10 .prologue const/4 v2, 0x0 const/16 v9, 0x1000 .line 324 invoke-static {p1}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object; .line 326 new-array v3, v9, [B .line 327 new-array v4, v9, [B .line 329 invoke-static {}, Lcom/google/common/io/Closer;->create()Lcom/google/common/io/Closer; move-result-object v5 .line 331 :try_start_0 invoke-virtual {p0}, Lcom/google/common/io/ByteSource;->openStream()Ljava/io/InputStream; move-result-object v0 invoke-virtual {v5, v0}, Lcom/google/common/io/Closer;->register(Ljava/io/Closeable;)Ljava/io/Closeable; move-result-object v0 check-cast v0, Ljava/io/InputStream; .line 332 invoke-virtual {p1}, Lcom/google/common/io/ByteSource;->openStream()Ljava/io/InputStream; move-result-object v1 invoke-virtual {v5, v1}, Lcom/google/common/io/Closer;->register(Ljava/io/Closeable;)Ljava/io/Closeable; move-result-object v1 check-cast v1, Ljava/io/InputStream; .line 334 :cond_0 const/4 v6, 0x0 const/16 v7, 0x1000 invoke-static {v0, v3, v6, v7}, Lcom/google/common/io/ByteStreams;->read(Ljava/io/InputStream;[BII)I move-result v6 .line 335 const/4 v7, 0x0 const/16 v8, 0x1000 invoke-static {v1, v4, v7, v8}, Lcom/google/common/io/ByteStreams;->read(Ljava/io/InputStream;[BII)I move-result v7 .line 336 if-ne v6, v7, :cond_1 invoke-static {v3, v4}, Ljava/util/Arrays;->equals([B[B)Z :try_end_0 .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 move-result v7 if-nez v7, :cond_2 .line 345 :cond_1 invoke-virtual {v5}, Lcom/google/common/io/Closer;->close()V move v0, v2 :goto_0 return v0 .line 338 :cond_2 if-eq v6, v9, :cond_0 .line 339 const/4 v0, 0x1 .line 345 invoke-virtual {v5}, Lcom/google/common/io/Closer;->close()V goto :goto_0 .line 342 :catch_0 move-exception v0 .line 343 :try_start_1 invoke-virtual {v5, v0}, Lcom/google/common/io/Closer;->rethrow(Ljava/lang/Throwable;)Ljava/lang/RuntimeException; move-result-object v0 throw v0 :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 .line 345 :catchall_0 move-exception v0 invoke-virtual {v5}, Lcom/google/common/io/Closer;->close()V throw v0 .end method .method public copyTo(Lcom/google/common/io/ByteSink;)J .locals 3 .prologue .line 250 invoke-static {p1}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object; .line 252 invoke-static {}, Lcom/google/common/io/Closer;->create()Lcom/google/common/io/Closer; move-result-object v2 .line 254 :try_start_0 invoke-virtual {p0}, Lcom/google/common/io/ByteSource;->openStream()Ljava/io/InputStream; move-result-object v0 invoke-virtual {v2, v0}, Lcom/google/common/io/Closer;->register(Ljava/io/Closeable;)Ljava/io/Closeable; move-result-object v0 check-cast v0, Ljava/io/InputStream; .line 255 invoke-virtual {p1}, Lcom/google/common/io/ByteSink;->openStream()Ljava/io/OutputStream; move-result-object v1 invoke-virtual {v2, v1}, Lcom/google/common/io/Closer;->register(Ljava/io/Closeable;)Ljava/io/Closeable; move-result-object v1 check-cast v1, Ljava/io/OutputStream; .line 256 invoke-static {v0, v1}, Lcom/google/common/io/ByteStreams;->copy(Ljava/io/InputStream;Ljava/io/OutputStream;)J :try_end_0 .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 move-result-wide v0 .line 260 invoke-virtual {v2}, Lcom/google/common/io/Closer;->close()V return-wide v0 .line 257 :catch_0 move-exception v0 .line 258 :try_start_1 invoke-virtual {v2, v0}, Lcom/google/common/io/Closer;->rethrow(Ljava/lang/Throwable;)Ljava/lang/RuntimeException; move-result-object v0 throw v0 :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 .line 260 :catchall_0 move-exception v0 invoke-virtual {v2}, Lcom/google/common/io/Closer;->close()V throw v0 .end method .method public copyTo(Ljava/io/OutputStream;)J .locals 4 .prologue .line 230 invoke-static {p1}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object; .line 232 invoke-static {}, Lcom/google/common/io/Closer;->create()Lcom/google/common/io/Closer; move-result-object v1 .line 234 :try_start_0 invoke-virtual {p0}, Lcom/google/common/io/ByteSource;->openStream()Ljava/io/InputStream; move-result-object v0 invoke-virtual {v1, v0}, Lcom/google/common/io/Closer;->register(Ljava/io/Closeable;)Ljava/io/Closeable; move-result-object v0 check-cast v0, Ljava/io/InputStream; .line 235 invoke-static {v0, p1}, Lcom/google/common/io/ByteStreams;->copy(Ljava/io/InputStream;Ljava/io/OutputStream;)J :try_end_0 .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 move-result-wide v2 .line 239 invoke-virtual {v1}, Lcom/google/common/io/Closer;->close()V return-wide v2 .line 236 :catch_0 move-exception v0 .line 237 :try_start_1 invoke-virtual {v1, v0}, Lcom/google/common/io/Closer;->rethrow(Ljava/lang/Throwable;)Ljava/lang/RuntimeException; move-result-object v0 throw v0 :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 .line 239 :catchall_0 move-exception v0 invoke-virtual {v1}, Lcom/google/common/io/Closer;->close()V throw v0 .end method .method public final getInput()Ljava/io/InputStream; .locals 1 .annotation runtime Ljava/lang/Deprecated; .end annotation .prologue .line 98 invoke-virtual {p0}, Lcom/google/common/io/ByteSource;->openStream()Ljava/io/InputStream; move-result-object v0 return-object v0 .end method .method public bridge synthetic getInput()Ljava/lang/Object; .locals 1 .prologue .line 59 invoke-virtual {p0}, Lcom/google/common/io/ByteSource;->getInput()Ljava/io/InputStream; move-result-object v0 return-object v0 .end method .method public hash(Lcom/google/common/hash/HashFunction;)Lcom/google/common/hash/HashCode; .locals 2 .prologue .line 311 invoke-interface {p1}, Lcom/google/common/hash/HashFunction;->newHasher()Lcom/google/common/hash/Hasher; move-result-object v0 .line 312 invoke-static {v0}, Lcom/google/common/hash/Funnels;->asOutputStream(Lcom/google/common/hash/PrimitiveSink;)Ljava/io/OutputStream; move-result-object v1 invoke-virtual {p0, v1}, Lcom/google/common/io/ByteSource;->copyTo(Ljava/io/OutputStream;)J .line 313 invoke-interface {v0}, Lcom/google/common/hash/Hasher;->hash()Lcom/google/common/hash/HashCode; move-result-object v0 return-object v0 .end method .method public isEmpty()Z .locals 3 .prologue .line 138 invoke-static {}, Lcom/google/common/io/Closer;->create()Lcom/google/common/io/Closer; move-result-object v1 .line 140 :try_start_0 invoke-virtual {p0}, Lcom/google/common/io/ByteSource;->openStream()Ljava/io/InputStream; move-result-object v0 invoke-virtual {v1, v0}, Lcom/google/common/io/Closer;->register(Ljava/io/Closeable;)Ljava/io/Closeable; move-result-object v0 check-cast v0, Ljava/io/InputStream; .line 141 invoke-virtual {v0}, Ljava/io/InputStream;->read()I :try_end_0 .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 move-result v0 const/4 v2, -0x1 if-ne v0, v2, :cond_0 const/4 v0, 0x1 .line 145 :goto_0 invoke-virtual {v1}, Lcom/google/common/io/Closer;->close()V return v0 .line 141 :cond_0 const/4 v0, 0x0 goto :goto_0 .line 142 :catch_0 move-exception v0 .line 143 :try_start_1 invoke-virtual {v1, v0}, Lcom/google/common/io/Closer;->rethrow(Ljava/lang/Throwable;)Ljava/lang/RuntimeException; move-result-object v0 throw v0 :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 .line 145 :catchall_0 move-exception v0 invoke-virtual {v1}, Lcom/google/common/io/Closer;->close()V throw v0 .end method .method public openBufferedStream()Ljava/io/InputStream; .locals 2 .prologue .line 114 invoke-virtual {p0}, Lcom/google/common/io/ByteSource;->openStream()Ljava/io/InputStream; move-result-object v0 .line 115 instance-of v1, v0, Ljava/io/BufferedInputStream; if-eqz v1, :cond_0 check-cast v0, Ljava/io/BufferedInputStream; :goto_0 return-object v0 :cond_0 new-instance v1, Ljava/io/BufferedInputStream; invoke-direct {v1, v0}, Ljava/io/BufferedInputStream;->(Ljava/io/InputStream;)V move-object v0, v1 goto :goto_0 .end method .method public abstract openStream()Ljava/io/InputStream; .end method .method public read(Lcom/google/common/io/ByteProcessor;)Ljava/lang/Object; .locals 2 .annotation build Lcom/google/common/annotations/Beta; .end annotation .annotation system Ldalvik/annotation/Signature; value = { "(", "Lcom/google/common/io/ByteProcessor", ";)TT;" } .end annotation .prologue .line 292 invoke-static {p1}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object; .line 294 invoke-static {}, Lcom/google/common/io/Closer;->create()Lcom/google/common/io/Closer; move-result-object v1 .line 296 :try_start_0 invoke-virtual {p0}, Lcom/google/common/io/ByteSource;->openStream()Ljava/io/InputStream; move-result-object v0 invoke-virtual {v1, v0}, Lcom/google/common/io/Closer;->register(Ljava/io/Closeable;)Ljava/io/Closeable; move-result-object v0 check-cast v0, Ljava/io/InputStream; .line 297 invoke-static {v0, p1}, Lcom/google/common/io/ByteStreams;->readBytes(Ljava/io/InputStream;Lcom/google/common/io/ByteProcessor;)Ljava/lang/Object; :try_end_0 .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 move-result-object v0 .line 301 invoke-virtual {v1}, Lcom/google/common/io/Closer;->close()V return-object v0 .line 298 :catch_0 move-exception v0 .line 299 :try_start_1 invoke-virtual {v1, v0}, Lcom/google/common/io/Closer;->rethrow(Ljava/lang/Throwable;)Ljava/lang/RuntimeException; move-result-object v0 throw v0 :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 .line 301 :catchall_0 move-exception v0 invoke-virtual {v1}, Lcom/google/common/io/Closer;->close()V throw v0 .end method .method public read()[B .locals 2 .prologue .line 270 invoke-static {}, Lcom/google/common/io/Closer;->create()Lcom/google/common/io/Closer; move-result-object v1 .line 272 :try_start_0 invoke-virtual {p0}, Lcom/google/common/io/ByteSource;->openStream()Ljava/io/InputStream; move-result-object v0 invoke-virtual {v1, v0}, Lcom/google/common/io/Closer;->register(Ljava/io/Closeable;)Ljava/io/Closeable; move-result-object v0 check-cast v0, Ljava/io/InputStream; .line 273 invoke-static {v0}, Lcom/google/common/io/ByteStreams;->toByteArray(Ljava/io/InputStream;)[B :try_end_0 .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 move-result-object v0 .line 277 invoke-virtual {v1}, Lcom/google/common/io/Closer;->close()V return-object v0 .line 274 :catch_0 move-exception v0 .line 275 :try_start_1 invoke-virtual {v1, v0}, Lcom/google/common/io/Closer;->rethrow(Ljava/lang/Throwable;)Ljava/lang/RuntimeException; move-result-object v0 throw v0 :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 .line 277 :catchall_0 move-exception v0 invoke-virtual {v1}, Lcom/google/common/io/Closer;->close()V throw v0 .end method .method public size()J .locals 3 .prologue .line 165 invoke-static {}, Lcom/google/common/io/Closer;->create()Lcom/google/common/io/Closer; move-result-object v2 .line 167 :try_start_0 invoke-virtual {p0}, Lcom/google/common/io/ByteSource;->openStream()Ljava/io/InputStream; move-result-object v0 invoke-virtual {v2, v0}, Lcom/google/common/io/Closer;->register(Ljava/io/Closeable;)Ljava/io/Closeable; move-result-object v0 check-cast v0, Ljava/io/InputStream; .line 168 invoke-direct {p0, v0}, Lcom/google/common/io/ByteSource;->countBySkipping(Ljava/io/InputStream;)J :try_end_0 .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 move-result-wide v0 .line 172 invoke-virtual {v2}, Lcom/google/common/io/Closer;->close()V .line 182 :goto_0 return-wide v0 .line 169 :catch_0 move-exception v0 .line 172 invoke-virtual {v2}, Lcom/google/common/io/Closer;->close()V .line 175 invoke-static {}, Lcom/google/common/io/Closer;->create()Lcom/google/common/io/Closer; move-result-object v2 .line 177 :try_start_1 invoke-virtual {p0}, Lcom/google/common/io/ByteSource;->openStream()Ljava/io/InputStream; move-result-object v0 invoke-virtual {v2, v0}, Lcom/google/common/io/Closer;->register(Ljava/io/Closeable;)Ljava/io/Closeable; move-result-object v0 check-cast v0, Ljava/io/InputStream; .line 178 invoke-direct {p0, v0}, Lcom/google/common/io/ByteSource;->countByReading(Ljava/io/InputStream;)J :try_end_1 .catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_1} :catch_1 .catchall {:try_start_1 .. :try_end_1} :catchall_1 move-result-wide v0 .line 182 invoke-virtual {v2}, Lcom/google/common/io/Closer;->close()V goto :goto_0 .line 172 :catchall_0 move-exception v0 invoke-virtual {v2}, Lcom/google/common/io/Closer;->close()V throw v0 .line 179 :catch_1 move-exception v0 .line 180 :try_start_2 invoke-virtual {v2, v0}, Lcom/google/common/io/Closer;->rethrow(Ljava/lang/Throwable;)Ljava/lang/RuntimeException; move-result-object v0 throw v0 :try_end_2 .catchall {:try_start_2 .. :try_end_2} :catchall_1 .line 182 :catchall_1 move-exception v0 invoke-virtual {v2}, Lcom/google/common/io/Closer;->close()V throw v0 .end method .method public slice(JJ)Lcom/google/common/io/ByteSource; .locals 7 .prologue .line 127 new-instance v0, Lcom/google/common/io/ByteSource$SlicedByteSource; const/4 v6, 0x0 move-object v1, p0 move-wide v2, p1 move-wide v4, p3 invoke-direct/range {v0 .. v6}, Lcom/google/common/io/ByteSource$SlicedByteSource;->(Lcom/google/common/io/ByteSource;JJLcom/google/common/io/ByteSource$1;)V return-object v0 .end method