remm 2003/09/21 12:25:32
Modified: http11/src/java/org/apache/coyote/http11/filters
GzipOutputFilter.java
Log:
- Fix compatibility with JDK 1.4.0 (bug 23276).
- Patch submitted by Steve Appling (with added & 0xff, which may be needed).
Revision Changes Path
1.2 +8 -3
jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/filters/GzipOutputFilter.java
Index: GzipOutputFilter.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/filters/GzipOutputFilter.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- GzipOutputFilter.java 18 Dec 2002 20:36:58 -0000 1.1
+++ GzipOutputFilter.java 21 Sep 2003 19:25:32 -0000 1.2
@@ -190,9 +190,14 @@
protected class FakeOutputStream
extends OutputStream {
protected ByteChunk outputChunk = new ByteChunk();
- public void write(int b) {
- // Shouldn't get called
- System.out.println("FIXME");
+ protected byte[] singleByteBuffer = new byte[1];
+ public void write(int b)
+ throws IOException {
+ // Shouldn't get used for good performance, but is needed for
+ // compatibility with Sun JDK 1.4.0
+ singleByteBuffer[0] = (byte) (b & 0xff);
+ outputChunk.setBytes(singleByteBuffer, 0, 1);
+ buffer.doWrite(outputChunk, null);
}
public void write(byte[] b, int off, int len)
throws IOException {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]