FilterServletOutputStream.java

1    package com.acme.filter;
2    
3    import javax.servlet.ServletOutputStream;
4    import java.io.DataOutputStream;
5    import java.io.IOException;
6    import java.io.OutputStream;
7    
8    public class FilterServletOutputStream extends ServletOutputStream {
9    
10       private DataOutputStream stream;
11   
12       public FilterServletOutputStream(OutputStream output) {
13           stream = new DataOutputStream(output);
14       }
15   
16       public void write(int b) throws IOException {
17           stream.write(b);
18       }
19   
20       public void write(byte[] b) throws IOException {
21           stream.write(b);
22       }
23   
24       public void write(byte[] b, int off, int len) throws IOException {
25           stream.write(b, off, len);
26       }
27   }
28