I'm not able to write files in cache directory
val file = File(context.cacheDir, usbFile.name)
val bufferedOutputStream = context.openFileOutput(usbFile.name, Context.MODE_PRIVATE).buffered()
val bufferedInoutStream = UsbFileInputStream(usbFile).buffered()
var read = 0
while ({ read = bufferedInoutStream.read(); read != -1 }()) {
bufferedOutputStream.write(read)
}
it works fine using context.filesDir but not context.cacheDir.. I'm using libaums Library to read USB files.