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();
}
}
Aggregations