We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7d4ce3f commit 2fe9c67Copy full SHA for 2fe9c67
1 file changed
rxhttp/src/main/java/rxhttp/wrapper/entity/OutputSreamWrapper.kt
@@ -1,5 +1,7 @@
1
package rxhttp.wrapper.entity
2
3
+import android.content.Context
4
+import android.net.Uri
5
import java.io.OutputStream
6
7
/**
@@ -13,4 +15,11 @@ data class OutputStreamWrapper<out T>(
13
15
override fun toString(): String = "($result, $os)"
14
16
}
17
-fun <T> OutputStream.toWrapper(that: T): OutputStreamWrapper<T> = OutputStreamWrapper(that, this)
18
+fun <T> OutputStream.toWrapper(that: T): OutputStreamWrapper<T> = OutputStreamWrapper(that, this)
19
+
20
+fun Uri.toWrapper(os: OutputStream): OutputStreamWrapper<Uri> = OutputStreamWrapper(this, os)
21
22
+fun Uri.toWrapper(context: Context): OutputStreamWrapper<Uri> {
23
+ val os = context.contentResolver.openOutputStream(this)
24
+ return OutputStreamWrapper(this, os)
25
+}
0 commit comments