toFileData
fun ByteArray.toFileData(filename: String, contentType: String?, offset: Int = 0, length: Int = size - offset): FileData(source)
Converts a ByteArray to a FileData object.
Return
the FileData representing this file
Parameters
offset
the offset to start reading from
length
the length to read until
filename
the name of the file
contentType
the content type of the file
fun ByteArray.toFileData(filename: String, offset: Int = 0, length: Int = size - offset): FileData(source)
Deprecated
Use toFileData(String, String?, Int, Int) instead.
Replace with
toFileData(filename, null, offset, length)
Content copied to clipboard