1
2
3
4
5
6
7 package org.mule.transport.servlet;
8
9 import java.io.ByteArrayInputStream;
10 import java.io.IOException;
11 import java.io.InputStream;
12
13 import javax.servlet.ServletInputStream;
14
15 public class MockServletInputStream extends ServletInputStream
16 {
17 private InputStream input;
18
19 public MockServletInputStream(InputStream dataStream)
20 {
21 super();
22 input = dataStream;
23 }
24
25 public MockServletInputStream()
26 {
27 this(new ByteArrayInputStream(new byte[0]));
28 }
29
30 @Override
31 public int read() throws IOException
32 {
33 return input.read();
34 }
35 }
36