From bebbb1515f9b8aca9d003102d7bdd4358c3f5f8d Mon Sep 17 00:00:00 2001 From: supalle Date: Sat, 4 Mar 2023 14:31:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81=E6=BB=A1?= =?UTF-8?q?=E8=B6=B3pmd=E7=BC=96=E7=A0=81=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../analysis/csv/BomBufferedInputStream.java | 1 - .../excel/analysis/csv/ByteOrderMark.java | 16 ++++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/easyexcel-core/src/main/java/com/alibaba/excel/analysis/csv/BomBufferedInputStream.java b/easyexcel-core/src/main/java/com/alibaba/excel/analysis/csv/BomBufferedInputStream.java index 9a53520d..c24a6e0c 100644 --- a/easyexcel-core/src/main/java/com/alibaba/excel/analysis/csv/BomBufferedInputStream.java +++ b/easyexcel-core/src/main/java/com/alibaba/excel/analysis/csv/BomBufferedInputStream.java @@ -66,7 +66,6 @@ public class BomBufferedInputStream extends BufferedInputStream { reset(); if (byteOrderMark != null) { - // read(new byte[byteOrderMark.length()]); skip(byteOrderMark.length()); } initialized = true; diff --git a/easyexcel-core/src/main/java/com/alibaba/excel/analysis/csv/ByteOrderMark.java b/easyexcel-core/src/main/java/com/alibaba/excel/analysis/csv/ByteOrderMark.java index 0c68351b..1ed078cf 100644 --- a/easyexcel-core/src/main/java/com/alibaba/excel/analysis/csv/ByteOrderMark.java +++ b/easyexcel-core/src/main/java/com/alibaba/excel/analysis/csv/ByteOrderMark.java @@ -46,14 +46,6 @@ public class ByteOrderMark implements Comparable { */ 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 Byte Order Mark (BOM) FAQ - * @since 2.5 - */ - public static final char UTF_BOM = '\uFEFF'; - private final Charset charset; private final int[] bytes; @@ -79,8 +71,12 @@ public class ByteOrderMark implements Comparable { @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } ByteOrderMark that = (ByteOrderMark) o; return Objects.equals(charset, that.charset) && Arrays.equals(bytes, that.bytes); }