快照輸入串流來源
public class SnapshotInputStreamSource
extends Object
implements InputStreamSource
java.lang.Object | |
↳ | com.android.tradefed.result.SnapshotInputStreamSource |
文件支援的InputStreamSource。建立原始ERROR(/InputStream)
內容的快照,以確保createInputStream()
將根據需要傳回行為相同的ERROR(/InputStream)
。
概括
公共構造函數 | |
---|---|
SnapshotInputStreamSource (String name, InputStream stream) 檔案支援的 |
公共方法 | |
---|---|
void | close () 對 InputStream 的來源進行任何所需的清理。 |
InputStream | createInputStream () 傳回 |
long | size () 傳回來源資料的大小(以位元組為單位)。 |
公共構造函數
快照輸入串流來源
public SnapshotInputStreamSource (String name, InputStream stream)
檔案支援的InputStreamSource
的建構函數
參數 | |
---|---|
name | String |
stream | InputStream |
公共方法
關閉
public void close ()
對 InputStream 的來源進行任何所需的清理。呼叫此方法本質上會使此InputStreamSource
失效。
建立輸入流
public InputStream createInputStream ()
傳回ERROR(/InputStream)
的新克隆,以便呼叫者可以從頭開始讀取流。每次呼叫此方法(直到呼叫cancel()
)都會傳回一個行為相同的ERROR(/InputStream)
- 將會傳回相同的內容。
退貨 | |
---|---|
InputStream | 呼叫者可以使用ERROR(/InputStream) 從頭開始讀取資料來源。如果此InputStreamSource 已因先前呼叫cancel() 失效,或者由於某些其他原因無法建立新的 InputStream,則可能會傳回null 。 |
尺寸
public long size ()
傳回來源資料的大小(以位元組為單位)。
退貨 | |
---|---|
long |