Skip to content

Commit

Permalink
Update readme (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
HectorNarvaez committed Aug 9, 2023
1 parent 12c088d commit d13ab05
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -377,20 +377,6 @@ If you are configuring this step by step on the `code-starter` branch:
cancellableCollector.addCancellable(cancellable)
```

To ensure proper resource management and improve the reliability of the code, we recommend adding the necessary code to close the `fileOutputStream` after the `bytes.writeTo(fileOutputStream)` operation.

**Example Using Kotlin's `use` Function:**
```kotlin
try {
FileOutputStream(fileToSave).use { fileOutputStream ->
bytes.writeTo(fileOutputStream)
// File was successfully saved
}
} catch (e: IOException) {
// Handle the exception here
}
```

**Note: Make sure to use the full implementation of [`downloadFileEvent`](https://github.com/openmobilehub/omh-storage/blob/release/1.0/storage-sample/src/main/java/com/omh/android/storage/sample/presentation/file_viewer/FileViewerViewModel.kt#L140-L178) for a fully functional sample.**

2. Run the sample app to download files.
Expand Down

0 comments on commit d13ab05

Please sign in to comment.