Returning a memory mapped InputStream from a content provider?

后端 未结 2 1438
不知归路
不知归路 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:46

    As of android-9, you can make a pipe using ParcelFileDescriptor. You can stuff up to 64k in it and be done with it, or you can set up another thread to fill it after its been read. See the answer here for more detail:

    Custom ContentProvider - openInputStream(), openOutputStream()

提交回复
热议问题