SparseImageUtil.SparseInputStream

public static class SparseImageUtil.SparseInputStream
extends InputStream

java.lang.Object
   ↳ java.io.InputStream
     ↳ 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

Throws
IOException

Public methods

close

public void close ()

Throws
IOException

isSparse

public boolean isSparse ()

Returns
boolean

read

public int read ()

Returns
int

Throws
IOException

read

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

Parameters
buf byte

off int

len int

Returns
int

Throws
IOException

size

public long size ()

Return the total number of bytes in the unsparsed image.

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