openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From allee8...@apache.org
Subject svn commit: r1366475 - /openjpa/trunk/openjpa-jest/src/main/java/org/apache/openjpa/persistence/jest/TokenReplacedStream.java
Date Fri, 27 Jul 2012 18:12:45 GMT
Author: allee8285
Date: Fri Jul 27 18:12:44 2012
New Revision: 1366475

URL: http://svn.apache.org/viewvc?rev=1366475&view=rev
Log:
OPENJPA-2231 - introduce replace method using Reader for input stream.

Modified:
    openjpa/trunk/openjpa-jest/src/main/java/org/apache/openjpa/persistence/jest/TokenReplacedStream.java

Modified: openjpa/trunk/openjpa-jest/src/main/java/org/apache/openjpa/persistence/jest/TokenReplacedStream.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jest/src/main/java/org/apache/openjpa/persistence/jest/TokenReplacedStream.java?rev=1366475&r1=1366474&r2=1366475&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jest/src/main/java/org/apache/openjpa/persistence/jest/TokenReplacedStream.java
(original)
+++ openjpa/trunk/openjpa-jest/src/main/java/org/apache/openjpa/persistence/jest/TokenReplacedStream.java
Fri Jul 27 18:12:44 2012
@@ -43,6 +43,11 @@ public class TokenReplacedStream {
      * input stream will be replaced by the (i+1)-th String in the output writer. 
      */
     public void replace(InputStream in, Writer out, String... prs) throws IOException {
+        BufferedReader inRdr = new BufferedReader(new InputStreamReader(in));
+        replace(inRdr, out, prs);
+    }
+
+    public void replace(Reader in, Writer out, String... prs) throws IOException {
         if (prs.length%2 != 0) 
             throw new IllegalArgumentException("Even number of pattern/string pairs: " +
Arrays.toString(prs) 
                 + ". Must be even number of arguments.");



Mime
View raw message