Skip to content

Commit baba8cc

Browse files
committed
IO-453 - Regression in FileUtils.readFileToString from 2.0.1
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/io/trunk@1614791 13f79535-47bb-0310-9956-ffa450edef68
1 parent d7d274c commit baba8cc

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/changes/changes.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ The <action> type attribute can be add,update,fix,remove.
4747
<body>
4848
<!-- The release date is the date RC is cut -->
4949
<release version="2.5" date="2014-??-??" description="New features and bug fixes.">
50+
<action issue="IO-453" dev="sebb" type="fix" due-to="Steven Christou">
51+
Regression in FileUtils.readFileToString from 2.0.1
52+
</action>
5053
<action issue="IO-451" dev="sebb" type="fix" due-to="David Standish">
5154
ant test fails - resources missing from test classpath
5255
</action>

src/main/java/org/apache/commons/io/FileUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1799,7 +1799,7 @@ public static byte[] readFileToByteArray(final File file) throws IOException {
17991799
InputStream in = null;
18001800
try {
18011801
in = openInputStream(file);
1802-
return IOUtils.toByteArray(in, file.length());
1802+
return IOUtils.toByteArray(in); // Do NOT use file.length() - see NET-453
18031803
} finally {
18041804
IOUtils.closeQuietly(in);
18051805
}

0 commit comments

Comments
 (0)