4

I am trying to open a file for writing via SAF (Storage Access Framework).

However I need the returned document/file to be written in random-access manner. SAF returns me an URI. I can get an OutputStream from that URI via getContentResolver().openOutputStream(uri) or get a FileDescriptor via getContentResolver().openFileDescriptor(uri, "rw") but I can't seem to find a way to get a RandomAccessFile from there. Is there any way to get a random access from there?

Randy Sugianto 'Yuku'
  • 71,383
  • 57
  • 178
  • 228
  • 3
    That's not possible at all because the approach changed with SAF. You should get two streams and use respective `FileChannel`s. See: https://stackoverflow.com/a/28805474/1950812 – fillobotto Jan 02 '18 at 20:01

0 Answers0