Skip to content
This repository was archived by the owner on Mar 13, 2023. It is now read-only.

Commit 626e105

Browse files
committed
Fix OOM error when downloading large videos
1 parent bf753bf commit 626e105

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/src/main/java/com/foreverrafs/hypervid/ui/downloads/DownloadsFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class DownloadsFragment : Fragment(R.layout.fragment_downloads),
157157
val fileStream = FileInputStream(videoFile)
158158

159159
stream?.apply {
160-
write(fileStream.readBytes())
160+
fileStream.copyTo(out = this, bufferSize = 1024)
161161
close()
162162
}
163163

0 commit comments

Comments
 (0)