ChunkedFileOutputStream
class ChunkedFileOutputStream(val filesDir: File, chunkSize: Int, chunkNameGenerator: (Int) -> String = { id -> "chunk_$id" }) : OutputStream
A class that allows to write into multiple files. It is useful when you want to upload a file to a server but you don't want to wait for the record to finish before.
Parameters
filesDir
the directory where the files will be written
chunkSize
the size of each file in bytes
chunkNameGenerator
generate the name of each file from its index
Types
Link copied to clipboard
interface Listener
Listener for ChunkedFileOutputStream
Functions
Link copied to clipboard
Adds a listener to the stream.
Link copied to clipboard
Close the stream. This will close the current file and call Listener.onFileAvailable with the last file.
Link copied to clipboard
Removes a listener from the stream.
Link copied to clipboard
Removes all listeners from the stream.