to top
public class

SnapshotInputStreamSource

extends Object
implements InputStreamSource
java.lang.Object
   ↳ com.android.tradefed.result.SnapshotInputStreamSource

Class Overview

A File-backed InputStreamSource. Creates a snapshot of original InputStream contents to ensure that createInputStream() will return identically-behaving InputStreams as required.

Summary

Public Constructors
SnapshotInputStreamSource(InputStream stream)
FIXME
Public Methods
synchronized void cancel()
Do any required cleanup on the source of the InputStream.
synchronized InputStream createInputStream()
Return a new clone of the InputStream, so that the caller can read the stream from the beginning.
long size()
Return the size in bytes of the source data.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.android.tradefed.result.InputStreamSource

Public Constructors

public SnapshotInputStreamSource (InputStream stream)

FIXME

Public Methods

public synchronized void cancel ()

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

public synchronized 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 long size ()

Return the size in bytes of the source data.