FileIOUtils

class FileIOUtils
    author: Blankj
    blog  : http://blankj.com
    time  : 2017/06/22
    desc  : utils about file io

Functions

readFile2BytesByChannel
Link copied to clipboard
open fun readFile2BytesByChannel(file: File): Array<Byte>
Return the bytes in file by channel.
open fun readFile2BytesByChannel(filePath: String): Array<Byte>
Return the bytes in file by channel.
readFile2BytesByMap
Link copied to clipboard
open fun readFile2BytesByMap(file: File): Array<Byte>
Return the bytes in file by map.
open fun readFile2BytesByMap(filePath: String): Array<Byte>
Return the bytes in file by map.
readFile2BytesByStream
Link copied to clipboard
open fun readFile2BytesByStream(file: File): Array<Byte>
Return the bytes in file by stream.
open fun readFile2BytesByStream(filePath: String): Array<Byte>
Return the bytes in file by stream.
readFile2List
Link copied to clipboard
open fun readFile2List(file: File): List<String>
Return the lines in file.
open fun readFile2List(filePath: String): List<String>
Return the lines in file.
open fun readFile2List(file: File, charsetName: String): List<String>
Return the lines in file.
open fun readFile2List(filePath: String, charsetName: String): List<String>
Return the lines in file.
open fun readFile2List(file: File, st: Int, end: Int): List<String>
Return the lines in file.
open fun readFile2List(filePath: String, st: Int, end: Int): List<String>
Return the lines in file.
open fun readFile2List(file: File, st: Int, end: Int, charsetName: String): List<String>
Return the lines in file.
open fun readFile2List(filePath: String, st: Int, end: Int, charsetName: String): List<String>
Return the lines in file.
readFile2String
Link copied to clipboard
open fun readFile2String(file: File): String
Return the string in file.
open fun readFile2String(filePath: String): String
Return the string in file.
open fun readFile2String(file: File, charsetName: String): String
Return the string in file.
open fun readFile2String(filePath: String, charsetName: String): String
Return the string in file.
setBufferSize
Link copied to clipboard
open fun setBufferSize(bufferSize: Int)
Set the buffer's size.
writeFileFromBytesByChannel
Link copied to clipboard
open fun writeFileFromBytesByChannel(file: File, bytes: Array<Byte>, isForce: Boolean): Boolean
Write file from bytes by channel.
open fun writeFileFromBytesByChannel(filePath: String, bytes: Array<Byte>, isForce: Boolean): Boolean
Write file from bytes by channel.
open fun writeFileFromBytesByChannel(file: File, bytes: Array<Byte>, append: Boolean, isForce: Boolean): Boolean
Write file from bytes by channel.
open fun writeFileFromBytesByChannel(filePath: String, bytes: Array<Byte>, append: Boolean, isForce: Boolean): Boolean
Write file from bytes by channel.
writeFileFromBytesByMap
Link copied to clipboard
open fun writeFileFromBytesByMap(file: File, bytes: Array<Byte>, isForce: Boolean): Boolean
Write file from bytes by map.
open fun writeFileFromBytesByMap(filePath: String, bytes: Array<Byte>, isForce: Boolean): Boolean
Write file from bytes by map.
open fun writeFileFromBytesByMap(file: File, bytes: Array<Byte>, append: Boolean, isForce: Boolean): Boolean
Write file from bytes by map.
open fun writeFileFromBytesByMap(filePath: String, bytes: Array<Byte>, append: Boolean, isForce: Boolean): Boolean
Write file from bytes by map.
writeFileFromBytesByStream
Link copied to clipboard
open fun writeFileFromBytesByStream(file: File, bytes: Array<Byte>): Boolean
Write file from bytes by stream.
open fun writeFileFromBytesByStream(filePath: String, bytes: Array<Byte>): Boolean
Write file from bytes by stream.
open fun writeFileFromBytesByStream(file: File, bytes: Array<Byte>, append: Boolean): Boolean
Write file from bytes by stream.
open fun writeFileFromBytesByStream(filePath: String, bytes: Array<Byte>, append: Boolean): Boolean
Write file from bytes by stream.
writeFileFromIS
Link copied to clipboard
open fun writeFileFromIS(file: File, is: InputStream): Boolean
Write file from input stream.
open fun writeFileFromIS(filePath: String, is: InputStream): Boolean
Write file from input stream.
open fun writeFileFromIS(file: File, is: InputStream, append: Boolean): Boolean
Write file from input stream.
open fun writeFileFromIS(filePath: String, is: InputStream, append: Boolean): Boolean
Write file from input stream.
writeFileFromString
Link copied to clipboard
open fun writeFileFromString(file: File, content: String): Boolean
Write file from string.
open fun writeFileFromString(filePath: String, content: String): Boolean
Write file from string.
open fun writeFileFromString(file: File, content: String, append: Boolean): Boolean
Write file from string.
open fun writeFileFromString(filePath: String, content: String, append: Boolean): Boolean
Write file from string.