|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| package com.opensymphony.oscache.web.filter; |
|
6 |
| |
|
7 |
| import java.io.IOException; |
|
8 |
| import java.io.OutputStream; |
|
9 |
| |
|
10 |
| import javax.servlet.ServletOutputStream; |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| |
|
16 |
| |
|
17 |
| |
|
18 |
| |
|
19 |
| |
|
20 |
| |
|
21 |
| |
|
22 |
| public class SplitServletOutputStream extends ServletOutputStream { |
|
23 |
| OutputStream captureStream = null; |
|
24 |
| OutputStream passThroughStream = null; |
|
25 |
| |
|
26 |
| |
|
27 |
| |
|
28 |
| |
|
29 |
| |
|
30 |
| |
|
31 |
| |
|
32 |
| |
|
33 |
| |
|
34 |
0
| public SplitServletOutputStream(OutputStream captureStream, OutputStream passThroughStream) {
|
|
35 |
0
| this.captureStream = captureStream;
|
|
36 |
0
| this.passThroughStream = passThroughStream;
|
|
37 |
| } |
|
38 |
| |
|
39 |
| |
|
40 |
| |
|
41 |
| |
|
42 |
| |
|
43 |
| |
|
44 |
| |
|
45 |
0
| public void write(int value) throws IOException {
|
|
46 |
0
| captureStream.write(value);
|
|
47 |
0
| passThroughStream.write(value);
|
|
48 |
| } |
|
49 |
| |
|
50 |
| |
|
51 |
| |
|
52 |
| |
|
53 |
| |
|
54 |
| |
|
55 |
| |
|
56 |
0
| public void write(byte[] value) throws IOException {
|
|
57 |
0
| captureStream.write(value);
|
|
58 |
0
| passThroughStream.write(value);
|
|
59 |
| } |
|
60 |
| |
|
61 |
| |
|
62 |
| |
|
63 |
| |
|
64 |
| |
|
65 |
| |
|
66 |
| |
|
67 |
| |
|
68 |
| |
|
69 |
0
| public void write(byte[] b, int off, int len) throws IOException {
|
|
70 |
0
| captureStream.write(b, off, len);
|
|
71 |
0
| passThroughStream.write(b, off, len);
|
|
72 |
| } |
|
73 |
| } |