@Throws(IOException::class) private fun dump(from: File, out: OutputStream) { writeHeader(from, out) var `in`: FileInputStream? = null try { `in` = FileInputStream(from) var count: Int while (`in`.read(buffer).also { count = it } != -1) { out.write(buffer, 0, count) } } finally { closeQuietly(`in`) } }
Copies from a file to an output stream .