diff --git a/src/main/org/apache/tools/ant/filters/TokenFilter.java b/src/main/org/apache/tools/ant/filters/TokenFilter.java index 73f873bf6..27d0a307d 100644 --- a/src/main/org/apache/tools/ant/filters/TokenFilter.java +++ b/src/main/org/apache/tools/ant/filters/TokenFilter.java @@ -65,6 +65,7 @@ import org.apache.tools.ant.types.EnumeratedAttribute; import org.apache.tools.ant.types.Parameter; import org.apache.tools.ant.types.RegularExpression; import org.apache.tools.ant.types.Substitution; +import org.apache.tools.ant.util.FileUtils; import org.apache.tools.ant.util.regexp.Regexp; /** @@ -358,17 +359,7 @@ public class TokenFilter public String getToken(Reader in) throws IOException { - StringBuffer output = new StringBuffer(); - char[] buffer = new char[8192]; - while (true) { - int nread = in.read(buffer, 0, 8192); - if (nread == -1) - break; - output.append(buffer, 0, nread); - } - if (output.length() == 0) - return null; - return output.toString(); + return FileUtils.readFully(in); } /**