|
1 | | -/** |
2 | | - * OWASP Enterprise Security API (ESAPI) |
3 | | - * |
4 | | - * This file is part of the Open Web Application Security Project (OWASP) |
5 | | - * Enterprise Security API (ESAPI) project. For details, please see |
6 | | - * <a href="http://www.owasp.org/index.php/ESAPI">http://www.owasp.org/index.php/ESAPI</a>. |
7 | | - * |
8 | | - * Copyright (c) 2007 - The OWASP Foundation |
9 | | - * |
10 | | - * The ESAPI is published by OWASP under the BSD license. You should read and accept the |
11 | | - * LICENSE before you use, modify, and/or redistribute this software. |
12 | | - * |
13 | | - * @author Jeff Williams <a href="http://www.aspectsecurity.com">Aspect Security</a> |
14 | | - * @created 2007 |
15 | | - */ |
16 | | -package org.owasp.esapi.http; |
17 | | - |
18 | | -import javax.servlet.ServletInputStream; |
19 | | -import java.io.IOException; |
20 | | - |
21 | | -/** |
22 | | - * |
23 | | - * @author jwilliams |
24 | | - */ |
25 | | -public class MockServletInputStream extends ServletInputStream { |
26 | | - |
27 | | - private byte[] body; |
28 | | - |
29 | | - private int next; |
30 | | - |
31 | | - /** |
32 | | - * constructor |
33 | | - * @param body |
34 | | - */ |
35 | | - public MockServletInputStream(byte[] body) { |
36 | | - this.body = body; |
37 | | - } |
38 | | - |
39 | | - /** |
40 | | - * read |
41 | | - * @return |
42 | | - * @throws IOException |
43 | | - */ |
44 | | - public int read() throws IOException { |
45 | | - if (next < body.length) { |
46 | | - return body[next++]; |
47 | | - } else { |
48 | | - return -1; |
49 | | - } |
50 | | - } |
51 | | -} |
| 1 | +/** |
| 2 | + * OWASP Enterprise Security API (ESAPI) |
| 3 | + * |
| 4 | + * This file is part of the Open Web Application Security Project (OWASP) |
| 5 | + * Enterprise Security API (ESAPI) project. For details, please see |
| 6 | + * <a href="http://www.owasp.org/index.php/ESAPI">http://www.owasp.org/index.php/ESAPI</a>. |
| 7 | + * |
| 8 | + * Copyright (c) 2007 - The OWASP Foundation |
| 9 | + * |
| 10 | + * The ESAPI is published by OWASP under the BSD license. You should read and accept the |
| 11 | + * LICENSE before you use, modify, and/or redistribute this software. |
| 12 | + * |
| 13 | + * @author Jeff Williams <a href="http://www.aspectsecurity.com">Aspect Security</a> |
| 14 | + * @created 2007 |
| 15 | + */ |
| 16 | +package org.owasp.esapi.http; |
| 17 | + |
| 18 | +import javax.servlet.ServletInputStream; |
| 19 | +import java.io.IOException; |
| 20 | + |
| 21 | +/** |
| 22 | + * |
| 23 | + * @author jwilliams |
| 24 | + */ |
| 25 | +public class MockServletInputStream extends ServletInputStream { |
| 26 | + |
| 27 | + private byte[] body; |
| 28 | + |
| 29 | + private int next; |
| 30 | + |
| 31 | + /** |
| 32 | + * constructor |
| 33 | + * @param body |
| 34 | + */ |
| 35 | + public MockServletInputStream(byte[] body) { |
| 36 | + this.body = body; |
| 37 | + } |
| 38 | + |
| 39 | + /** |
| 40 | + * read |
| 41 | + * @return |
| 42 | + * @throws IOException |
| 43 | + */ |
| 44 | + public int read() throws IOException { |
| 45 | + if (next < body.length) { |
| 46 | + return body[next++]; |
| 47 | + } else { |
| 48 | + return -1; |
| 49 | + } |
| 50 | + } |
| 51 | +} |
0 commit comments