public interface

InputStreamSource

com.android.tradefed.result.InputStreamSource
Known Indirect Subclasses

Class Overview

This interface basically wraps an InputStream to make it clonable.

It should be expected that a resource will be leaked unless cancel() is called, and that once cancel() is called on an instance, that that instance and any InputStreams it has created will be invalid.

Summary

Public Methods
abstract void cancel()
Do any required cleanup on the source of the InputStream.
abstract InputStream createInputStream()
Return a new clone of the InputStream, so that the caller can read the stream from the beginning.
abstract long size()
Return the size in bytes of the source data.

Public Methods

public abstract void cancel ()

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

public abstract InputStream createInputStream ()

Return a new clone of the InputStream, so that the caller can read the stream from the beginning. Each invocation of this method (until cancel() is called) will return an identically-behaving InputStream -- the same contents will be returned.

Returns
  • An InputStream that the caller can use to read the data source from the beginning. May return null if this InputStreamSource has been invalidated by a prior call to cancel(), or if a new InputStream cannot be created for some other reason.

public abstract long size ()

Return the size in bytes of the source data.