1 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 32 33 public class MockServletInputStream extends ServletInputStream 34 { 35 private InputStream _inner; 36 37 public MockServletInputStream(String path) throws IOException 38 { 39 _inner = new FileInputStream (path); 40 } 41 42 public int read() throws IOException 43 { 44 return _inner.read(); 45 } 46 47 public int available() throws IOException 48 { 49 return _inner.available(); 50 } 51 52 public void close() throws IOException 53 { 54 _inner.close(); 55 } 56 57 public synchronized void mark(int readlimit) 58 { 59 _inner.mark(readlimit); 60 } 61 62 public boolean markSupported() 63 { 64 return _inner.markSupported(); 65 } 66 67 public int read(byte[] b, int off, int len) throws IOException 68 { 69 return _inner.read(b, off, len); 70 } 71 72 public int read(byte[] b) throws IOException 73 { 74 return _inner.read(b); 75 } 76 77 public synchronized void reset() throws IOException 78 { 79 _inner.reset(); 80 } 81 82 public long skip(long n) throws IOException 83 { 84 return _inner.skip(n); 85 } 86 87 } 88 | Popular Tags |