You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
247 lines
5.6 KiB
247 lines
5.6 KiB
.class Lcom/google/common/io/ByteSource$ByteArrayByteSource; |
|
.super Lcom/google/common/io/ByteSource; |
|
.source "ByteSource.java" |
|
|
|
|
|
# annotations |
|
.annotation system Ldalvik/annotation/EnclosingClass; |
|
value = Lcom/google/common/io/ByteSource; |
|
.end annotation |
|
|
|
.annotation system Ldalvik/annotation/InnerClass; |
|
accessFlags = 0xa |
|
name = "ByteArrayByteSource" |
|
.end annotation |
|
|
|
|
|
# instance fields |
|
.field protected final bytes:[B |
|
|
|
|
|
# direct methods |
|
.method protected constructor <init>([B)V |
|
.locals 1 |
|
|
|
.prologue |
|
.line 509 |
|
invoke-direct {p0}, Lcom/google/common/io/ByteSource;-><init>()V |
|
|
|
.line 510 |
|
invoke-static {p1}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object; |
|
|
|
move-result-object v0 |
|
|
|
check-cast v0, [B |
|
|
|
iput-object v0, p0, Lcom/google/common/io/ByteSource$ByteArrayByteSource;->bytes:[B |
|
|
|
.line 511 |
|
return-void |
|
.end method |
|
|
|
|
|
# virtual methods |
|
.method public copyTo(Ljava/io/OutputStream;)J |
|
.locals 2 |
|
|
|
.prologue |
|
.line 540 |
|
iget-object v0, p0, Lcom/google/common/io/ByteSource$ByteArrayByteSource;->bytes:[B |
|
|
|
invoke-virtual {p1, v0}, Ljava/io/OutputStream;->write([B)V |
|
|
|
.line 541 |
|
iget-object v0, p0, Lcom/google/common/io/ByteSource$ByteArrayByteSource;->bytes:[B |
|
|
|
array-length v0, v0 |
|
|
|
int-to-long v0, v0 |
|
|
|
return-wide v0 |
|
.end method |
|
|
|
.method public bridge synthetic getInput()Ljava/lang/Object; |
|
.locals 1 |
|
|
|
.prologue |
|
.line 505 |
|
invoke-super {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 1 |
|
|
|
.prologue |
|
.line 552 |
|
iget-object v0, p0, Lcom/google/common/io/ByteSource$ByteArrayByteSource;->bytes:[B |
|
|
|
invoke-interface {p1, v0}, Lcom/google/common/hash/HashFunction;->hashBytes([B)Lcom/google/common/hash/HashCode; |
|
|
|
move-result-object v0 |
|
|
|
return-object v0 |
|
.end method |
|
|
|
.method public isEmpty()Z |
|
.locals 1 |
|
|
|
.prologue |
|
.line 525 |
|
iget-object v0, p0, Lcom/google/common/io/ByteSource$ByteArrayByteSource;->bytes:[B |
|
|
|
array-length v0, v0 |
|
|
|
if-nez v0, :cond_0 |
|
|
|
const/4 v0, 0x1 |
|
|
|
:goto_0 |
|
return v0 |
|
|
|
:cond_0 |
|
const/4 v0, 0x0 |
|
|
|
goto :goto_0 |
|
.end method |
|
|
|
.method public openBufferedStream()Ljava/io/InputStream; |
|
.locals 1 |
|
|
|
.prologue |
|
.line 520 |
|
invoke-virtual {p0}, Lcom/google/common/io/ByteSource$ByteArrayByteSource;->openStream()Ljava/io/InputStream; |
|
|
|
move-result-object v0 |
|
|
|
return-object v0 |
|
.end method |
|
|
|
.method public openStream()Ljava/io/InputStream; |
|
.locals 2 |
|
|
|
.prologue |
|
.line 515 |
|
new-instance v0, Ljava/io/ByteArrayInputStream; |
|
|
|
iget-object v1, p0, Lcom/google/common/io/ByteSource$ByteArrayByteSource;->bytes:[B |
|
|
|
invoke-direct {v0, v1}, Ljava/io/ByteArrayInputStream;-><init>([B)V |
|
|
|
return-object v0 |
|
.end method |
|
|
|
.method public read(Lcom/google/common/io/ByteProcessor;)Ljava/lang/Object; |
|
.locals 3 |
|
.annotation system Ldalvik/annotation/Signature; |
|
value = { |
|
"<T:", |
|
"Ljava/lang/Object;", |
|
">(", |
|
"Lcom/google/common/io/ByteProcessor", |
|
"<TT;>;)TT;" |
|
} |
|
.end annotation |
|
|
|
.prologue |
|
.line 546 |
|
iget-object v0, p0, Lcom/google/common/io/ByteSource$ByteArrayByteSource;->bytes:[B |
|
|
|
const/4 v1, 0x0 |
|
|
|
iget-object v2, p0, Lcom/google/common/io/ByteSource$ByteArrayByteSource;->bytes:[B |
|
|
|
array-length v2, v2 |
|
|
|
invoke-interface {p1, v0, v1, v2}, Lcom/google/common/io/ByteProcessor;->processBytes([BII)Z |
|
|
|
.line 547 |
|
invoke-interface {p1}, Lcom/google/common/io/ByteProcessor;->getResult()Ljava/lang/Object; |
|
|
|
move-result-object v0 |
|
|
|
return-object v0 |
|
.end method |
|
|
|
.method public read()[B |
|
.locals 1 |
|
|
|
.prologue |
|
.line 535 |
|
iget-object v0, p0, Lcom/google/common/io/ByteSource$ByteArrayByteSource;->bytes:[B |
|
|
|
invoke-virtual {v0}, [B->clone()Ljava/lang/Object; |
|
|
|
move-result-object v0 |
|
|
|
check-cast v0, [B |
|
|
|
return-object v0 |
|
.end method |
|
|
|
.method public size()J |
|
.locals 2 |
|
|
|
.prologue |
|
.line 530 |
|
iget-object v0, p0, Lcom/google/common/io/ByteSource$ByteArrayByteSource;->bytes:[B |
|
|
|
array-length v0, v0 |
|
|
|
int-to-long v0, v0 |
|
|
|
return-wide v0 |
|
.end method |
|
|
|
.method public toString()Ljava/lang/String; |
|
.locals 4 |
|
|
|
.prologue |
|
.line 559 |
|
new-instance v0, Ljava/lang/StringBuilder; |
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V |
|
|
|
const-string v1, "ByteSource.wrap(" |
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v0 |
|
|
|
invoke-static {}, Lcom/google/common/io/BaseEncoding;->base16()Lcom/google/common/io/BaseEncoding; |
|
|
|
move-result-object v1 |
|
|
|
iget-object v2, p0, Lcom/google/common/io/ByteSource$ByteArrayByteSource;->bytes:[B |
|
|
|
invoke-virtual {v1, v2}, Lcom/google/common/io/BaseEncoding;->encode([B)Ljava/lang/String; |
|
|
|
move-result-object v1 |
|
|
|
const/16 v2, 0x1e |
|
|
|
const-string v3, "..." |
|
|
|
invoke-static {v1, v2, v3}, Lcom/google/common/base/Ascii;->truncate(Ljava/lang/CharSequence;ILjava/lang/String;)Ljava/lang/String; |
|
|
|
move-result-object v1 |
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v0 |
|
|
|
const-string v1, ")" |
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v0 |
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; |
|
|
|
move-result-object v0 |
|
|
|
return-object v0 |
|
.end method
|
|
|