magnusja / libaums

Open source library to access USB Mass Storage devices on Android without rooting your device
Apache License 2.0
1.26k stars 270 forks source link

Make FileBlockDeviceDriver writes sync #382

Closed depau closed 1 year ago

depau commented 1 year ago

I'm assuming FileBlockDeviceDriver is only used in tests.

This change makes all writes to the backing RandomAccessFile synchronous by opening them as "rws", which will make tests more reliable.

This is not an issue with your tests, but it's a bit of a pain with the tests for my block device input/output streams.

https://docs.oracle.com/javase/7/docs/api/java/io/RandomAccessFile.html#RandomAccessFile(java.io.File,%20java.lang.String)