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 13:38:14 UTC
[commons-io] branch master updated: Use Files API instead of custom fixture building code.
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 4a3f5edc Use Files API instead of custom fixture building code.
4a3f5edc is described below
commit 4a3f5edca499f145459562dfda5723ab13a979d1
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jun 21 09:38:07 2022 -0400
Use Files API instead of custom fixture building code.
---
src/test/java/org/apache/commons/io/FileUtilsTest.java | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/src/test/java/org/apache/commons/io/FileUtilsTest.java b/src/test/java/org/apache/commons/io/FileUtilsTest.java
index eea1dde8..cd39eac3 100644
--- a/src/test/java/org/apache/commons/io/FileUtilsTest.java
+++ b/src/test/java/org/apache/commons/io/FileUtilsTest.java
@@ -2445,11 +2445,7 @@ public class FileUtilsTest extends AbstractTempDirTest {
@Test
public void testReadFileToByteArray() throws Exception {
final File file = new File(tempDirFile, "read.txt");
- final OutputStream out = Files.newOutputStream(file.toPath());
- out.write(11);
- out.write(21);
- out.write(31);
- out.close();
+ Files.write(file.toPath(), new byte[] {11, 21, 31});
final byte[] data = FileUtils.readFileToByteArray(file);
assertEquals(3, data.length);