1 17 18 package org.apache.coyote.http11.filters; 19 20 import java.io.IOException ; 21 22 import org.apache.tomcat.util.buf.ByteChunk; 23 24 import org.apache.coyote.OutputBuffer; 25 import org.apache.coyote.Response; 26 import org.apache.coyote.http11.OutputFilter; 27 28 34 public class VoidOutputFilter implements OutputFilter { 35 36 37 39 40 protected static final String ENCODING_NAME = "void"; 41 protected static final ByteChunk ENCODING = new ByteChunk(); 42 43 44 46 47 static { 48 ENCODING.setBytes(ENCODING_NAME.getBytes(), 0, ENCODING_NAME.length()); 49 } 50 51 52 54 55 58 protected OutputBuffer buffer; 59 60 61 63 64 69 public int doWrite(ByteChunk chunk, Response res) 70 throws IOException { 71 72 return chunk.getLength(); 73 74 } 75 76 77 79 80 85 public void setResponse(Response response) { 86 } 87 88 89 92 public void setBuffer(OutputBuffer buffer) { 93 this.buffer = buffer; 94 } 95 96 97 100 public void recycle() { 101 } 102 103 104 108 public ByteChunk getEncodingName() { 109 return ENCODING; 110 } 111 112 113 122 public long end() 123 throws IOException { 124 return 0; 125 } 126 127 128 } 129 | Popular Tags |