Enum Class CompressType

java.lang.Object
java.lang.Enum<CompressType>
com.imyeyu.compress.CompressType
All Implemented Interfaces:
Serializable, Comparable<CompressType>, Constable

public enum CompressType extends Enum<CompressType>
压缩算法类型
Version:
2024-06-30 18:03
Author:
夜雨
  • Enum Constant Details

  • Method Details

    • values

      public static CompressType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CompressType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getCompressor

      public Compressor<?> getCompressor() throws Exception
      获取压缩操作对象
      Returns:
      压缩操作对象
      Throws:
      Exception - 实例化失败
    • compressFrom

      public Compressor<?> compressFrom(String fromPath) throws Exception
      获取带源路径的压缩操作对象
      Parameters:
      fromPath - 源路径
      Returns:
      压缩操作对象
      Throws:
      Exception - 实例化失败
    • compressFrom

      public Compressor<?> compressFrom(File fromFile) throws Exception
      获取带源文件的压缩操作对象
      Parameters:
      fromFile - 源文件
      Returns:
      压缩操作对象
      Throws:
      Exception - 实例化失败
    • getDecompressor

      public Decompressor<?> getDecompressor() throws Exception
      获取解压操作对象
      Returns:
      解压操作对象
      Throws:
      Exception - 实例化失败
    • decompressedFrom

      public Decompressor<?> decompressedFrom(File fromFile) throws Exception
      获取带源文件的解压操作对象
      Parameters:
      fromFile - 源压缩文件
      Returns:
      解压操作对象
      Throws:
      Exception - 实例化失败
    • decompressedFrom

      public Decompressor<?> decompressedFrom(InputStream fromStream) throws Exception
      获取带源输入流的解压操作对象
      Parameters:
      fromStream - 源压缩输入流
      Returns:
      解压操作对象
      Throws:
      Exception - 实例化失败
    • from

      public static Decompressor<?> from(File file) throws Exception
      根据文件获取解压操作对象 会读取文件头识别压缩格式
      Parameters:
      file - 文件
      Returns:
      解压操作对象
      Throws:
      UnsupportedOperationException - 不支持的文件
      Exception - 实例化失败