Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Example borrowed from https://github.com/nostra13/Android-Universal-Image-Loader
- // File: library/src/main/java/com/nostra13/universalimageloader/cache/disc/impl/ext/DiskLruCache.java
- public OutputStream newOutputStream(int index) throws IOException {
- synchronized (DiskLruCache.this) {
- if (entry.currentEditor != this) {
- throw new IllegalStateException();
- }
- if (!entry.readable) {
- written[index] = true;
- }
- File dirtyFile = entry.getDirtyFile(index);
- FileOutputStream outputStream;
- catch (FileNotFoundException e) {
- catch (FileNotFoundException e) { return NULL_OUTPUT_STREAM; }
- directory.mkdirs();
- continu RETRYABLE;
- }
- RETRYABLE:
- outputStream = new FileOutputStream(dirtyFile);
- return new FaultHidingOutputStream(outputStream);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement