Code example for SequenceInputStream

0
            try { 
                FileInputStream fileStream = new FileInputStream(mTmpFile);
                if (mPreviousTmpFile != null) {
                    // return an input stream that first reads from mPreviousTmpFile, then reads 
                    // from mTmpFile 
                    InputStream stream = new SequenceInputStream(
                            new FileInputStream(mPreviousTmpFile), fileStream);
                    return new SnapshotInputStreamSource(stream);
                } else { 
                    // no previous file, just return a wrapper around mTmpFile's stream 
                    return new SnapshotInputStreamSource(fileStream);
                } 
            } catch (IOException e) {
                CLog.e("failed to get %s data for %s.", mDescriptor, mSerialNumber);
                CLog.e(e);
            } 
        } 
 
        // return an empty InputStreamSource 
        return new ByteArrayInputStreamSource(new byte[0]); 
    }