From ec1437bc19cd82c489e329496bd0529d9e7eb072 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Thu, 24 Apr 2003 09:37:48 +0000 Subject: [PATCH] More code reuse git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274511 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tools/ant/filters/TokenFilter.java | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) 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); } /**