JohnyTex
JohnyTex

Reputation: 3481

Can I pass my InputStream directly in open ParcelFileDescriptor openFile() of ContentProvider?

I have an InputStream that I want to pass on to the openFile() method of a ContentProvider. Can I somehow pass my InputStream directly, somehow wrapping it in a ParcelFileDescriptor? Or do I have to create a pipe and then manually read from the InputStream and write to the OutputStream of the pipe? If I could, I'd like to just pass the stream along, but maybe it isn't possible?

Upvotes: 2

Views: 924

Answers (1)

pskink
pskink

Reputation: 24730

you have to use a pipe for that. fortunately there is a helper method for this that makes your life easier, see openPipeHelper

Upvotes: 2

Related Questions