优化
This commit is contained in:
@@ -11,12 +11,25 @@ import java.io.InputStream
|
|||||||
@Keep
|
@Keep
|
||||||
@Suppress("unused","MemberVisibilityCanBePrivate")
|
@Suppress("unused","MemberVisibilityCanBePrivate")
|
||||||
object RarUtils {
|
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?) {
|
fun unRarToPath(inputStream: InputStream, destDir: File?) {
|
||||||
Archive(inputStream).use {
|
Archive(inputStream).use {
|
||||||
unRarToPath(it, destDir)
|
unRarToPath(it, destDir)
|
||||||
}
|
}
|
||||||
inputStream.close()
|
inputStream.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun unRarToPath(byteArray: ByteArray, destDir: File?) {
|
fun unRarToPath(byteArray: ByteArray, destDir: File?) {
|
||||||
Archive(ByteArrayInputStream(byteArray)).use {
|
Archive(ByteArrayInputStream(byteArray)).use {
|
||||||
unRarToPath(it, destDir)
|
unRarToPath(it, destDir)
|
||||||
|
|||||||
@@ -15,7 +15,18 @@ import java.nio.channels.FileChannel
|
|||||||
@Suppress("unused","MemberVisibilityCanBePrivate")
|
@Suppress("unused","MemberVisibilityCanBePrivate")
|
||||||
object SevenZipUtils {
|
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?){
|
fun un7zToPath(inputStream: InputStream, destDir: File?){
|
||||||
un7zToPath(SevenZFile(SeekableInMemoryByteChannel(inputStream.readBytes())),destDir)
|
un7zToPath(SevenZFile(SeekableInMemoryByteChannel(inputStream.readBytes())),destDir)
|
||||||
|
|||||||
Reference in New Issue
Block a user