FileInputStreamSource

public class FileInputStreamSource
extends Object implements InputStreamSource

java.lang.Object
com.android.tradefed.result.FileInputStreamSource


Объект InputStreamSource , принимающий на вход файл.

Ответственность за удаление файла лежит на звонящем.

Краткое содержание

Государственные строители

FileInputStreamSource (File file)
FileInputStreamSource (File file, boolean deleteFileOnCancel)

Цтор

Общедоступные методы

void cleanFile ()

Convenience method to delete the file associated with the FileInputStreamSource.

void close ()

Do any required cleanup on the source of the InputStream.

InputStream createInputStream ()

Return a new clone of the InputStream , so that the caller can read the stream from the beginning.

File getFile ()

Возвращает базовый файл.

long size ()

Возвращает размер исходных данных в байтах.

Государственные строители

FileInputStreamSource

public FileInputStreamSource (File file)

Параметры
file File

FileInputStreamSource

public FileInputStreamSource (File file, 
                boolean deleteFileOnCancel)

Цтор

Параметры
file File : File , содержащий данные для потоковой передачи.

deleteFileOnCancel boolean : if true, the file associated will be deleted when close() is called

Общедоступные методы

чистый файл

public void cleanFile ()

Convenience method to delete the file associated with the FileInputStreamSource. Not safe.

закрывать

public void close ()

Do any required cleanup on the source of the InputStream. Calling this method essentially invalidates this InputStreamSource .

создать поток ввода

public InputStream createInputStream ()

Возвращает новый клон InputStream , чтобы вызывающая сторона могла читать поток с самого начала. Каждый вызов этого метода (до вызова cancel() ) будет возвращать InputStream с идентичным поведением — будет возвращено то же содержимое.

Возвраты
InputStream InputStream , который вызывающая сторона может использовать для чтения источника данных с самого начала. Может возвращать null если этот InputStreamSource был аннулирован предыдущим вызовом cancel() или если новый InputStream не может быть создан по какой-либо другой причине.

получить файл

public File getFile ()

Returns the underlying file. File is not guarantee to exists anymore once the stream is closed.

Возвраты
File

размер

public long size ()

Возвращает размер исходных данных в байтах.

Возвраты
long