Enum CommonBOM

    • Enum Constant Detail

      • UTF_8

        public static final CommonBOM UTF_8
        The UTF_8 BOM
      • UTF_16BE

        public static final CommonBOM UTF_16BE
        The UTF_16BE BOM.
      • UTF_16LE

        public static final CommonBOM UTF_16LE
        The UTF_16LE BOM.
      • UTF_32BE

        public static final CommonBOM UTF_32BE
        The UTF_32BE BOM.
      • UTF_32LE

        public static final CommonBOM UTF_32LE
        The UTF_32LE BOM.
    • Field Detail

      • MAX_BOM_SIZE

        public static final int MAX_BOM_SIZE
        The constant MAX_BOM_SIZE.
    • Method Detail

      • values

        public static CommonBOM[] 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 (CommonBOM c : CommonBOM.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static CommonBOM valueOf​(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:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • length

        public int length()
        The number of byhtes in the bom
        Returns:
        The BOM length
      • getCharset

        public Charset getCharset()
        The charset associated with the bom
        Returns:
        The associated Charset
      • matches

        public boolean matches​(byte[] rhs)
        Determines if the BOM is at the beginning of a given byte array.
        Parameters:
        rhs - The byte array to compare against
        Returns:
        True if the BOM is present, false otherwise