mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -11,12 +11,25 @@ import java.io.InputStream
|
||||
@Keep
|
||||
@Suppress("unused","MemberVisibilityCanBePrivate")
|
||||
object RarUtils {
|
||||
fun unRarToPath(inputStream: InputStream,path:String){
|
||||
unRarToPath(inputStream, File(path))
|
||||
}
|
||||
fun unRarToPath(byteArray: ByteArray,path:String){
|
||||
unRarToPath(byteArray, File(path))
|
||||
}
|
||||
fun unRarToPath(zipPath:String,path:String){
|
||||
unRarToPath(zipPath, File(path))
|
||||
}
|
||||
fun unRarToPath(file: File,path:String){
|
||||
unRarToPath(file, File(path))
|
||||
}
|
||||
fun unRarToPath(inputStream: InputStream, destDir: File?) {
|
||||
Archive(inputStream).use {
|
||||
unRarToPath(it, destDir)
|
||||
}
|
||||
inputStream.close()
|
||||
}
|
||||
|
||||
fun unRarToPath(byteArray: ByteArray, destDir: File?) {
|
||||
Archive(ByteArrayInputStream(byteArray)).use {
|
||||
unRarToPath(it, destDir)
|
||||
|
||||
@@ -15,7 +15,18 @@ import java.nio.channels.FileChannel
|
||||
@Suppress("unused","MemberVisibilityCanBePrivate")
|
||||
object SevenZipUtils {
|
||||
|
||||
|
||||
fun un7zToPath(inputStream: InputStream, path:String){
|
||||
un7zToPath(inputStream,File(path))
|
||||
}
|
||||
fun un7zToPath(byteArray: ByteArray, path:String){
|
||||
un7zToPath(byteArray,File(path))
|
||||
}
|
||||
fun un7zToPath(pfd: ParcelFileDescriptor, path:String){
|
||||
un7zToPath(pfd,File(path))
|
||||
}
|
||||
fun un7zToPath(fileChannel: FileChannel, path:String){
|
||||
un7zToPath(fileChannel,File(path))
|
||||
}
|
||||
|
||||
fun un7zToPath(inputStream: InputStream, destDir: File?){
|
||||
un7zToPath(SevenZFile(SeekableInMemoryByteChannel(inputStream.readBytes())),destDir)
|
||||
|
||||
Reference in New Issue
Block a user