1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package com.xpn.xwiki.web.includeservletasstring; |
21 |
|
|
22 |
|
import java.io.ByteArrayOutputStream; |
23 |
|
import java.io.IOException; |
24 |
|
|
25 |
|
import javax.servlet.ServletOutputStream; |
26 |
|
|
|
|
| 60% |
Uncovered Elements: 6 (15) |
Complexity: 7 |
Complexity Density: 0.88 |
|
27 |
|
public class BufferOutputStream extends ServletOutputStream |
28 |
|
{ |
29 |
|
protected ByteArrayOutputStream buffer; |
30 |
|
|
31 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
32 |
1 |
public BufferOutputStream()... |
33 |
|
{ |
34 |
1 |
this.buffer = new ByteArrayOutputStream(); |
35 |
|
} |
36 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
37 |
0 |
@Override... |
38 |
|
public void write(int b) throws IOException |
39 |
|
{ |
40 |
0 |
this.buffer.write(b); |
41 |
|
} |
42 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
43 |
0 |
@Override... |
44 |
|
public void write(byte b[]) throws IOException |
45 |
|
{ |
46 |
0 |
this.buffer.write(b); |
47 |
|
} |
48 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
49 |
1 |
@Override... |
50 |
|
public void write(byte[] b, int off, int len) throws IOException |
51 |
|
{ |
52 |
1 |
this.buffer.write(b, off, len); |
53 |
|
} |
54 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
55 |
1 |
@Override... |
56 |
|
public void flush() throws IOException |
57 |
|
{ |
58 |
1 |
this.buffer.flush(); |
59 |
|
} |
60 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
61 |
0 |
@Override... |
62 |
|
public void close() throws IOException |
63 |
|
{ |
64 |
0 |
this.buffer.close(); |
65 |
|
} |
66 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
67 |
1 |
public byte[] getContentsAsByteArray() throws IOException... |
68 |
|
{ |
69 |
1 |
flush(); |
70 |
1 |
return this.buffer.toByteArray(); |
71 |
|
} |
72 |
|
|
73 |
|
} |