You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2017/02/17 20:22:15 UTC
svn commit: r1783461 -
/tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java
Author: markt
Date: Fri Feb 17 20:22:15 2017
New Revision: 1783461
URL: http://svn.apache.org/viewvc?rev=1783461&view=rev
Log:
Refactoring with an eye on BZ 59901.
Return a buffered InputStream. When the refactoring is complete, this will be reset and reused.
Modified:
tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java
Modified: tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java?rev=1783461&r1=1783460&r2=1783461&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java Fri Feb 17 20:22:15 2017
@@ -16,6 +16,7 @@
*/
package org.apache.jasper.compiler;
+import java.io.BufferedInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
@@ -60,6 +61,8 @@ public class JspUtil {
"synchronized", "this", "throw", "throws", "transient", "try",
"void", "volatile", "while" };
+ static final int JSP_INPUT_STREAM_BUFFER_SIZE = 1024;
+
public static final int CHUNKSIZE = 1024;
/**
@@ -660,7 +663,7 @@ public class JspUtil {
}
}
- public static InputStream getInputStream(String fname, Jar jar,
+ public static BufferedInputStream getInputStream(String fname, Jar jar,
JspCompilationContext ctxt) throws IOException {
InputStream in = null;
@@ -677,7 +680,7 @@ public class JspUtil {
"jsp.error.file.not.found", fname));
}
- return in;
+ return new BufferedInputStream(in, JspUtil.JSP_INPUT_STREAM_BUFFER_SIZE);
}
public static InputSource getInputSource(String fname, Jar jar, JspCompilationContext ctxt)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org