Search in sources :

Example 1 with OutputStreamPipe

use of com.hippo.streampipe.OutputStreamPipe in project EhViewer by seven332.

the class SpiderQueen method writeSpiderInfoToLocal.

private synchronized void writeSpiderInfoToLocal(@NonNull SpiderInfo spiderInfo) {
    // Write to download dir
    UniFile downloadDir = mSpiderDen.getDownloadDir();
    if (downloadDir != null) {
        UniFile file = downloadDir.createFile(SPIDER_INFO_FILENAME);
        try {
            spiderInfo.write(file.openOutputStream());
        } catch (Exception e) {
        // Ignore
        }
    }
    // Read from cache
    OutputStreamPipe pipe = mSpiderInfoCache.getOutputStreamPipe(Long.toString(mGalleryInfo.gid));
    try {
        pipe.obtain();
        spiderInfo.write(pipe.open());
    } catch (IOException e) {
    // Ignore
    } finally {
        pipe.close();
        pipe.release();
    }
}
Also used : UniFile(com.hippo.unifile.UniFile) OutputStreamPipe(com.hippo.streampipe.OutputStreamPipe) IOException(java.io.IOException) Image509Exception(com.hippo.ehviewer.client.exception.Image509Exception) ParseException(com.hippo.ehviewer.client.exception.ParseException) IOException(java.io.IOException)

Aggregations

Image509Exception (com.hippo.ehviewer.client.exception.Image509Exception)1 ParseException (com.hippo.ehviewer.client.exception.ParseException)1 OutputStreamPipe (com.hippo.streampipe.OutputStreamPipe)1 UniFile (com.hippo.unifile.UniFile)1 IOException (java.io.IOException)1