01: package com.mockrunner.mock.web;
02:
03: import java.io.ByteArrayInputStream;
04: import java.io.IOException;
05:
06: import javax.servlet.ServletInputStream;
07:
08: /**
09: * Mock implementation of <code>ServletInputStream</code>.
10: */
11: public class MockServletInputStream extends ServletInputStream {
12: private ByteArrayInputStream stream;
13:
14: public MockServletInputStream(byte[] data) {
15: stream = new ByteArrayInputStream(data);
16: }
17:
18: public int read() throws IOException {
19: return stream.read();
20: }
21: }
|