1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| package org.apache.tapestry.test.mock; |
16 |
| |
17 |
| import java.io.FileInputStream; |
18 |
| import java.io.IOException; |
19 |
| import java.io.InputStream; |
20 |
| |
21 |
| import javax.servlet.ServletInputStream; |
22 |
| |
23 |
| |
24 |
| |
25 |
| |
26 |
| |
27 |
| |
28 |
| |
29 |
| |
30 |
| |
31 |
| |
32 |
| |
33 |
| public class MockServletInputStream extends ServletInputStream |
34 |
| { |
35 |
| private InputStream _inner; |
36 |
| |
37 |
5
| public MockServletInputStream(String path) throws IOException
|
38 |
| { |
39 |
5
| _inner = new FileInputStream(path);
|
40 |
| } |
41 |
| |
42 |
0
| public int read() throws IOException
|
43 |
| { |
44 |
0
| return _inner.read();
|
45 |
| } |
46 |
| |
47 |
0
| public int available() throws IOException
|
48 |
| { |
49 |
0
| return _inner.available();
|
50 |
| } |
51 |
| |
52 |
0
| public void close() throws IOException
|
53 |
| { |
54 |
0
| _inner.close();
|
55 |
| } |
56 |
| |
57 |
0
| public synchronized void mark(int readlimit)
|
58 |
| { |
59 |
0
| _inner.mark(readlimit);
|
60 |
| } |
61 |
| |
62 |
0
| public boolean markSupported()
|
63 |
| { |
64 |
0
| return _inner.markSupported();
|
65 |
| } |
66 |
| |
67 |
7
| public int read(byte[] b, int off, int len) throws IOException
|
68 |
| { |
69 |
7
| return _inner.read(b, off, len);
|
70 |
| } |
71 |
| |
72 |
0
| public int read(byte[] b) throws IOException
|
73 |
| { |
74 |
0
| return _inner.read(b);
|
75 |
| } |
76 |
| |
77 |
0
| public synchronized void reset() throws IOException
|
78 |
| { |
79 |
0
| _inner.reset();
|
80 |
| } |
81 |
| |
82 |
0
| public long skip(long n) throws IOException
|
83 |
| { |
84 |
0
| return _inner.skip(n);
|
85 |
| } |
86 |
| |
87 |
| } |