Don't use depreacted constants.
import java.math.BigInteger;
import java.net.URL;
import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Arrays;
@@ -2384,11 +2385,11 @@ public void testWriteByteArrayToFile_WithOffsetAndLength_WithAppendOptionTrue_Sh
final File file = TestUtils.newFile(temporaryFolder, "lines.txt");
FileUtils.writeStringToFile(file, "This line was there before you...");
- final byte[] data = "SKIP_THIS_this is brand new data_AND_SKIP_THIS".getBytes(Charsets.UTF_8);
+ final byte[] data = "SKIP_THIS_this is brand new data_AND_SKIP_THIS".getBytes(StandardCharsets.UTF_8);
FileUtils.writeByteArrayToFile(file, data, 10, 22, true);
final String expected = "This line was there before you..." + "this is brand new data";
- final String actual = FileUtils.readFileToString(file, Charsets.UTF_8);
+ final String actual = FileUtils.readFileToString(file, StandardCharsets.UTF_8);
assertEquals(expected, actual);
}
@@ -2397,11 +2398,11 @@ public void testWriteByteArrayToFile_WithOffsetAndLength_WithAppendOptionTrue_Sh
final File file = TestUtils.newFile(temporaryFolder, "lines.txt");
FileUtils.writeStringToFile(file, "This line was there before you...");
- final byte[] data = "SKIP_THIS_this is brand new data_AND_SKIP_THIS".getBytes(Charsets.UTF_8);
+ final byte[] data = "SKIP_THIS_this is brand new data_AND_SKIP_THIS".getBytes(StandardCharsets.UTF_8);
FileUtils.writeByteArrayToFile(file, data, 10, 22, false);
final String expected = "this is brand new data";
- final String actual = FileUtils.readFileToString(file, Charsets.UTF_8);
+ final String actual = FileUtils.readFileToString(file, StandardCharsets.UTF_8);
assertEquals(expected, actual);
}
