You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2020/03/30 04:31:09 UTC
[camel] branch master updated: Delete IOHelper#newStringFromBytes
(#3690)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 5e0cad9 Delete IOHelper#newStringFromBytes (#3690)
5e0cad9 is described below
commit 5e0cad910ab6c0d0f5b79b5d94b6a283304774fb
Author: Pascal Schumacher <pa...@gmx.net>
AuthorDate: Mon Mar 30 06:30:53 2020 +0200
Delete IOHelper#newStringFromBytes (#3690)
---
.../test/java/org/apache/camel/util/IOHelperTest.java | 12 ------------
.../src/main/java/org/apache/camel/util/IOHelper.java | 17 -----------------
2 files changed, 29 deletions(-)
diff --git a/core/camel-core/src/test/java/org/apache/camel/util/IOHelperTest.java b/core/camel-core/src/test/java/org/apache/camel/util/IOHelperTest.java
index 363a6d2..b502b6f 100644
--- a/core/camel-core/src/test/java/org/apache/camel/util/IOHelperTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/util/IOHelperTest.java
@@ -50,18 +50,6 @@ public class IOHelperTest extends Assert {
}
@Test
- public void testNewStringFromBytes() {
- String s = IOHelper.newStringFromBytes("Hello".getBytes());
- assertEquals("Hello", s);
- }
-
- @Test
- public void testNewStringFromBytesWithStart() {
- String s = IOHelper.newStringFromBytes("Hello".getBytes(), 2, 3);
- assertEquals("llo", s);
- }
-
- @Test
public void testCopyAndCloseInput() throws Exception {
InputStream is = new ByteArrayInputStream("Hello".getBytes());
OutputStream os = new ByteArrayOutputStream();
diff --git a/core/camel-util/src/main/java/org/apache/camel/util/IOHelper.java b/core/camel-util/src/main/java/org/apache/camel/util/IOHelper.java
index f6a5e25..34089ce 100644
--- a/core/camel-util/src/main/java/org/apache/camel/util/IOHelper.java
+++ b/core/camel-util/src/main/java/org/apache/camel/util/IOHelper.java
@@ -40,7 +40,6 @@ import java.nio.channels.FileChannel;
import java.nio.channels.ReadableByteChannel;
import java.nio.channels.WritableByteChannel;
import java.nio.charset.Charset;
-import java.nio.charset.StandardCharsets;
import java.nio.charset.UnsupportedCharsetException;
import java.util.function.Supplier;
@@ -68,22 +67,6 @@ public final class IOHelper {
}
/**
- * Use this function instead of new String(byte[]) to avoid surprises from
- * non-standard default encodings.
- */
- public static String newStringFromBytes(byte[] bytes) {
- return new String(bytes, StandardCharsets.UTF_8);
- }
-
- /**
- * Use this function instead of new String(byte[], int, int) to avoid
- * surprises from non-standard default encodings.
- */
- public static String newStringFromBytes(byte[] bytes, int start, int length) {
- return new String(bytes, start, length, StandardCharsets.UTF_8);
- }
-
- /**
* Wraps the passed <code>in</code> into a {@link BufferedInputStream}
* object and returns that. If the passed <code>in</code> is already an
* instance of {@link BufferedInputStream} returns the same passed