Enum FileFormat

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<FileFormat>

    public enum FileFormat
    extends java.lang.Enum<FileFormat>
    Import and export formats that are supported.
    • Field Detail

      • extensions

        private final java.lang.String[] extensions
      • description

        private final java.lang.String description
      • magicBytes

        private final byte[] magicBytes
      • offset

        private final int offset
      • maxMagicByteLength

        private static int maxMagicByteLength
      • lock

        private static final java.lang.Object lock
      • fileFilter

        private javax.swing.filechooser.FileFilter fileFilter
    • Constructor Detail

      • FileFormat

        private FileFormat​(java.lang.String description,
                           byte[] magicBytes,
                           java.lang.String... extensions)
      • FileFormat

        private FileFormat​(java.lang.String description,
                           java.lang.String... extensions)
      • FileFormat

        private FileFormat​(java.lang.String description,
                           int offset,
                           byte[] magicBytes,
                           java.lang.String... extensions)
    • Method Detail

      • values

        public static FileFormat[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (FileFormat c : FileFormat.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static FileFormat valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getExtensions

        public java.lang.String[] getExtensions()
      • getFileFilter

        public javax.swing.filechooser.FileFilter getFileFilter()
      • getDescription

        public java.lang.String getDescription()
      • guess

        public static FileFormat guess​(java.lang.String filename)
      • guess

        public static FileFormat guess​(java.io.File file)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • getMaxMagicByteLength

        public static int getMaxMagicByteLength()
      • getOffset

        private int getOffset()
      • getMagicBytes

        private byte[] getMagicBytes()
      • isImage

        public static boolean isImage​(FileFormat fileformat)
      • isCompressed

        public static boolean isCompressed​(FileFormat fileformat)
      • isText

        public static boolean isText​(FileFormat fileformat)
      • guess

        public static FileFormat guess​(byte[] data)
      • guess

        public static FileFormat guess​(java.io.InputStream is)
                                throws java.io.IOException
        Throws:
        java.io.IOException