Package 

Class IOKtxKt

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final static String fileSize
    • Method Summary

      Modifier and Type Method Description
      final String getFileSize()
      final static Boolean copy(InputStream $self, File destinationFile, Integer bufferSize) 将当前输入流(InputStream)中的数据复制到指定的文件中,并返回复制操作是否成功。
      final static Boolean copy(InputStream $self, String destinationPath, Integer bufferSize) 将当前输入流(InputStream)中的数据复制到由路径指定的新文件中,并返回复制操作是否成功。
      final static Boolean copy(String $self, String destinationPath, Integer bufferSize) 将由当前字符串表示的文件路径的文件内容复制到指定的新文件路径,并返回复制操作是否成功。
      final static String saveAs(Bitmap $self, Bitmap.CompressFormat imageType, Integer compressQuality, String album, String imageFileName) 将 Bitmap 对象保存到系统相册。 请确保在调用此函数之前 application 已经被初始化,因为它依赖于应用程序的上下文来发送广播通知系统图片已更新。
      final static String fileSizeSummation(List<String> fileSizes) 计算一组文件大小字符串的总和,并返回格式化的总大小字符串。
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • copy

         final static Boolean copy(InputStream $self, File destinationFile, Integer bufferSize)

        将当前输入流(InputStream)中的数据复制到指定的文件中,并返回复制操作是否成功。

        Parameters:
        destinationFile - 要复制数据到的目标文件。
        bufferSize - 用于复制操作的缓冲区大小,默认为4096字节。
      • copy

         final static Boolean copy(InputStream $self, String destinationPath, Integer bufferSize)

        将当前输入流(InputStream)中的数据复制到由路径指定的新文件中,并返回复制操作是否成功。

        Parameters:
        destinationPath - 目标文件的路径。
        bufferSize - 用于复制操作的缓冲区大小,默认为4096字节。
      • copy

         final static Boolean copy(String $self, String destinationPath, Integer bufferSize)

        将由当前字符串表示的文件路径的文件内容复制到指定的新文件路径,并返回复制操作是否成功。

        Parameters:
        destinationPath - 要复制数据到的目标文件路径。
        bufferSize - 用于复制操作的缓冲区大小,默认为4096字节。
      • saveAs

         final static String saveAs(Bitmap $self, Bitmap.CompressFormat imageType, Integer compressQuality, String album, String imageFileName)

        将 Bitmap 对象保存到系统相册。 请确保在调用此函数之前 application 已经被初始化,因为它依赖于应用程序的上下文来发送广播通知系统图片已更新。

        Parameters:
        imageType - 压缩格式,如 PNG 或 JPEG。
        compressQuality - 压缩质量,从0(最差)到100(无损)。
        album - 相册名称,用于在公共图片目录下创建子目录。
        imageFileName - 要保存的图片文件名,如果为 null,则使用当前日期和时间。
      • fileSizeSummation

         final static String fileSizeSummation(List<String> fileSizes)

        计算一组文件大小字符串的总和,并返回格式化的总大小字符串。

        Parameters:
        fileSizes - 包含文件大小的字符串列表,格式如"123 KB"或"456.