Class ByteOrderMark

    • Constructor Summary

      Constructors 
      Constructor Description
      ByteOrderMark​(java.lang.String charsetName, int... bytes)
      Construct a new BOM.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      Indicates if this BOM's bytes equals another.
      int get​(int pos)
      The byte at the specified position.
      byte[] getBytes()
      Return a copy of the BOM's bytes.
      java.lang.String getCharsetName()
      Return the name of the Charset the BOM represents.
      int hashCode()
      Return the hashcode for this BOM.
      int length()
      Return the length of the BOM's bytes.
      java.lang.String toString()
      Provide a String representation of the BOM.
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ByteOrderMark

        public ByteOrderMark​(java.lang.String charsetName,
                             int... bytes)
        Construct a new BOM.
        Parameters:
        charsetName - The name of the charset the BOM represents
        bytes - The BOM's bytes
        Throws:
        java.lang.IllegalArgumentException - if the charsetName is null or zero length
        java.lang.IllegalArgumentException - if the bytes are null or zero length
    • Method Detail

      • getCharsetName

        public java.lang.String getCharsetName()
        Return the name of the Charset the BOM represents.
        Returns:
        the character set name
      • length

        public int length()
        Return the length of the BOM's bytes.
        Returns:
        the length of the BOM's bytes
      • get

        public int get​(int pos)
        The byte at the specified position.
        Parameters:
        pos - The position
        Returns:
        The specified byte
      • getBytes

        public byte[] getBytes()
        Return a copy of the BOM's bytes.
        Returns:
        a copy of the BOM's bytes
      • equals

        public boolean equals​(java.lang.Object obj)
        Indicates if this BOM's bytes equals another.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - The object to compare to
        Returns:
        true if the bom's bytes are equal, otherwise false
      • hashCode

        public int hashCode()
        Return the hashcode for this BOM.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hashcode for this BOM.
        See Also:
        Object.hashCode()
      • toString

        public java.lang.String toString()
        Provide a String representation of the BOM.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the length of the BOM's bytes