You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2001/09/17 07:29:09 UTC
cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote Request.java Response.java
remm 01/09/16 22:29:09
Modified: coyote/src/java/org/apache/coyote Request.java Response.java
Log:
- Use some byte chunks instead of passing arrays. That allows all sorts of
tricks since it's fully possible to replace the internal array, append data, ...
Revision Changes Path
1.3 +4 -3 jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java
Index: Request.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Request.java 2001/07/10 02:55:02 1.2
+++ Request.java 2001/09/17 05:29:09 1.3
@@ -64,6 +64,7 @@
import java.util.Enumeration;
import java.util.Hashtable;
+import org.apache.tomcat.util.buf.ByteChunk;
import org.apache.tomcat.util.buf.MessageBytes;
import org.apache.tomcat.util.buf.UDecoder;
@@ -327,11 +328,11 @@
/**
- * Read data from the input buffer and put it into a byte array.
+ * Read data from the input buffer and put it into a byte chunk.
*/
- public int doRead(byte b[], int off, int len)
+ public int doRead(ByteChunk chunk/*byte b[], int off, int len*/)
throws IOException {
- int n = inputBuffer.doRead(b, off, len);
+ int n = inputBuffer.doRead(chunk);
if (n > 0)
available -= n;
return n;
1.3 +4 -2 jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Response.java
Index: Response.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Response.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Response.java 2001/07/10 02:55:02 1.2
+++ Response.java 2001/09/17 05:29:09 1.3
@@ -63,6 +63,8 @@
import java.io.IOException;
import java.util.Locale;
+import org.apache.tomcat.util.buf.ByteChunk;
+
import org.apache.tomcat.util.res.StringManager;
import org.apache.tomcat.util.http.MimeHeaders;
@@ -414,9 +416,9 @@
/**
* Write a chunk of bytes.
*/
- public void doWrite(byte buffer[], int pos, int count)
+ public void doWrite(ByteChunk chunk/*byte buffer[], int pos, int count*/)
throws IOException {
- outputBuffer.doWrite(buffer, pos, count);
+ outputBuffer.doWrite(chunk);
}