costin 02/04/09 10:57:13
Modified: coyote/src/java/org/apache/coyote InputBuffer.java
Log:
Added (another) piece of comment ( after hunting for NPEs :-)
The way InputBuffer is used is different from OutputBuffer - the param
is empty, the byte[]. The protocol is supposed to provide it.
BTW, this is a very cool idea - it avoids one copy and allocations,
and simplifies the code. But it deserves a comment :-).
One question for future - who should 'own' the OutputBuffer's buffer ?
If we consistently say that the buffers are owned by the protocol we
could make another improvement in speed - since in Ajp case we could
avoid another copy.
Revision Changes Path
1.5 +5 -0
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/InputBuffer.java
Index: InputBuffer.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/InputBuffer.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- InputBuffer.java 8 Apr 2002 23:46:32 -0000 1.4
+++ InputBuffer.java 9 Apr 2002 17:57:13 -0000 1.5
@@ -72,6 +72,11 @@
public interface InputBuffer {
+ /** Return from the input stream.
+ IMPORTANT: the current model assumes that the protocol will 'own' the
+ buffer and return a pointer to it in ByteChunk ( i.e. the param will
+ have chunk.getBytes()==null before call, and the result after the call ).
+ */
public int doRead(ByteChunk chunk)
throws IOException;
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>