Class ByteOrderMark

java.lang.Object
org.apache.commons.io.ByteOrderMark
All Implemented Interfaces:
Serializable

public class ByteOrderMark extends Object implements Serializable
Byte Order Mark (BOM) representation. See BOMInputStream.

We define the follow BOM constants:

Deprecating Serialization

Serialization is deprecated and will be removed in 3.0.

Since:
2.0
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • equals

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

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

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

      Gets the name of the Charset the BOM represents.
      Returns:
      the character set name
    • hashCode

      public int hashCode()
      Computes the hash code for this BOM.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code for this BOM.
      See Also:
    • length

      public int length()
      Gets the length of the BOM's bytes.
      Returns:
      the length of the BOM's bytes
    • toString

      public String toString()
      Converts this instance to a String representation of the BOM.
      Overrides:
      toString in class Object
      Returns:
      the length of the BOM's bytes