You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/06/21 17:51:54 UTC

[commons-io] branch master updated: Reuse StandardCharsets

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git


The following commit(s) were added to refs/heads/master by this push:
     new a2e012d5 Reuse StandardCharsets
a2e012d5 is described below

commit a2e012d5486becae451ca837273ffebe45d910b3
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jun 21 13:51:48 2022 -0400

    Reuse StandardCharsets
---
 src/main/java/org/apache/commons/io/ByteOrderMark.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/commons/io/ByteOrderMark.java b/src/main/java/org/apache/commons/io/ByteOrderMark.java
index 18a3b045..3d5494ea 100644
--- a/src/main/java/org/apache/commons/io/ByteOrderMark.java
+++ b/src/main/java/org/apache/commons/io/ByteOrderMark.java
@@ -17,6 +17,7 @@
 package org.apache.commons.io;
 
 import java.io.Serializable;
+import java.nio.charset.StandardCharsets;
 import java.util.Locale;
 import java.util.Objects;
 
@@ -34,13 +35,13 @@ public class ByteOrderMark implements Serializable {
     private static final long serialVersionUID = 1L;
 
     /** UTF-8 BOM. */
-    public static final ByteOrderMark UTF_8    = new ByteOrderMark("UTF-8", 0xEF, 0xBB, 0xBF);
+    public static final ByteOrderMark UTF_8 = new ByteOrderMark(StandardCharsets.UTF_8.name(), 0xEF, 0xBB, 0xBF);
 
     /** UTF-16BE BOM (Big-Endian). */
-    public static final ByteOrderMark UTF_16BE = new ByteOrderMark("UTF-16BE", 0xFE, 0xFF);
+    public static final ByteOrderMark UTF_16BE = new ByteOrderMark(StandardCharsets.UTF_16BE.name(), 0xFE, 0xFF);
 
     /** UTF-16LE BOM (Little-Endian). */
-    public static final ByteOrderMark UTF_16LE = new ByteOrderMark("UTF-16LE", 0xFF, 0xFE);
+    public static final ByteOrderMark UTF_16LE = new ByteOrderMark(StandardCharsets.UTF_16LE.name(), 0xFF, 0xFE);
 
     /**
      * UTF-32BE BOM (Big-Endian).