SnapshotInputStreamSource
public
class
SnapshotInputStreamSource
extends Object
implements
InputStreamSource
| java.lang.Object | |
| ↳ | com.android.tradefed.result.SnapshotInputStreamSource |
以檔案為基礎的 InputStreamSource。建立原始 InputStream 內容的快照,確保 createInputStream() 會傳回行為相同的 InputStream (如必要)。
摘要
公用建構函式 | |
|---|---|
SnapshotInputStreamSource(String name, InputStream stream)
檔案支援的 |
|
公用方法 | |
|---|---|
void
|
close()
在 InputStream 的來源上執行任何必要的清除作業。 |
InputStream
|
createInputStream()
傳回 |
long
|
size()
傳回來源資料的大小 (以位元組為單位)。 |
公用建構函式
SnapshotInputStreamSource
public SnapshotInputStreamSource (String name,
InputStream stream)以檔案為基礎的 InputStreamSource 建構函式
| 參數 | |
|---|---|
name |
String |
stream |
InputStream |
公用方法
關閉
public void close ()
在 InputStream 的來源上執行任何必要的清除作業。呼叫這個方法基本上會使這個 InputStreamSource 失效。
createInputStream
public InputStream createInputStream ()
傳回 InputStream 的新副本,讓呼叫端可以從頭讀取串流。每次叫用這個方法 (直到呼叫 cancel() 為止) 都會傳回行為相同的 InputStream,也就是傳回相同內容。
| 傳回 | |
|---|---|
InputStream |
呼叫端可使用此 InputStream 從頭讀取資料來源。如果先前呼叫 cancel() 時已使這個 InputStreamSource 失效,或因其他原因無法建立新的 InputStream,則可能會傳回 null。 |
大小
public long size ()
傳回來源資料的大小 (以位元組為單位)。
| 傳回 | |
|---|---|
long |
|