Returning a memory mapped InputStream from a content provider?

后端 未结 2 1437
不知归路
不知归路 2020-12-31 22:07

The the client side of a content provider consumer I can do something like this, to get a proper InputStream for reading the picture:

InputStream is = getCon         


        
2条回答
  •  清酒与你
    2020-12-31 22:52

    This is tough. You might be able to get away with using anything that can use a Socket interface. I haven't done it, but this is what makes me think so:

    http://developer.android.com/reference/android/os/ParcelFileDescriptor.html#fromSocket(java.net.Socket)

    And a Socket could, in theory, be an Internet resource, or most anything...if you're willing to work at the Socket level. I would probably just give up and create the temporary file. Perhaps that makes me a coward.

提交回复
热议问题