|
|
@ -46,14 +46,6 @@ public class ByteOrderMark implements Comparable<ByteOrderMark> { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static final ByteOrderMark UTF_32LE = new ByteOrderMark(Charset.forName("UTF-32LE"), 0xFF, 0xFE, 0x00, 0x00); |
|
|
|
public static final ByteOrderMark UTF_32LE = new ByteOrderMark(Charset.forName("UTF-32LE"), 0xFF, 0xFE, 0x00, 0x00); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Unicode BOM character; external form depends on the encoding. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @see <a href="http://unicode.org/faq/utf_bom.html#BOM">Byte Order Mark (BOM) FAQ</a> |
|
|
|
|
|
|
|
* @since 2.5 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static final char UTF_BOM = '\uFEFF'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final Charset charset; |
|
|
|
private final Charset charset; |
|
|
|
private final int[] bytes; |
|
|
|
private final int[] bytes; |
|
|
|
|
|
|
|
|
|
|
@ -79,8 +71,12 @@ public class ByteOrderMark implements Comparable<ByteOrderMark> { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean equals(Object o) { |
|
|
|
public boolean equals(Object o) { |
|
|
|
if (this == o) return true; |
|
|
|
if (this == o) { |
|
|
|
if (o == null || getClass() != o.getClass()) return false; |
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (o == null || getClass() != o.getClass()) { |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
ByteOrderMark that = (ByteOrderMark) o; |
|
|
|
ByteOrderMark that = (ByteOrderMark) o; |
|
|
|
return Objects.equals(charset, that.charset) && Arrays.equals(bytes, that.bytes); |
|
|
|
return Objects.equals(charset, that.charset) && Arrays.equals(bytes, that.bytes); |
|
|
|
} |
|
|
|
} |
|
|
|