Search in sources :

Example 1 with UniFileOutputStreamPipe

use of com.hippo.io.UniFileOutputStreamPipe in project EhViewer by seven332.

the class SpiderDen method openDownloadOutputStreamPipe.

/**
 * @param extension without dot
 */
@Nullable
private OutputStreamPipe openDownloadOutputStreamPipe(int index, @Nullable String extension) {
    UniFile dir = getDownloadDir();
    if (dir == null) {
        return null;
    }
    extension = fixExtension('.' + extension);
    UniFile file = dir.createFile(generateImageFilename(index, extension));
    if (file != null) {
        return new UniFileOutputStreamPipe(file);
    } else {
        return null;
    }
}
Also used : UniFile(com.hippo.unifile.UniFile) UniFileOutputStreamPipe(com.hippo.io.UniFileOutputStreamPipe) Nullable(android.support.annotation.Nullable)

Aggregations

Nullable (android.support.annotation.Nullable)1 UniFileOutputStreamPipe (com.hippo.io.UniFileOutputStreamPipe)1 UniFile (com.hippo.unifile.UniFile)1