SparseImageUtil.SparseInputStream

public static class SparseImageUtil.SparseInputStream
extends Object

java.lang.Object
   ↳ com.android.tradefed.util.SparseImageUtil.SparseInputStream


SparseInputStream read from upstream and detects the data format. If the upstream is a valid sparse data, it will unsparse it on the fly. Otherwise, it just passthrough as is.

Summary

Public constructors

SparseInputStream(BufferedInputStream in, long originalSize)

Public methods

void close()
boolean isSparse()
int read()
int read(byte[] buf, int off, int len)
long size()

Return the total number of bytes in the unsparsed image.

Public constructors

SparseInputStream

public SparseInputStream (BufferedInputStream in, 
                long originalSize)

Parameters
in BufferedInputStream

originalSize long

Public methods

close

public void close ()

isSparse

public boolean isSparse ()

Returns
boolean

read

public int read ()

Returns
int

read

public int read (byte[] buf, 
                int off, 
                int len)

Parameters
buf byte

off int

len int

Returns
int

size

public long size ()

Return the total number of bytes in the unsparsed image.

Returns
long mOriginalSize if underlying stream is already non-sparse.