1 16 17 package org.apache.ajp.tomcat4; 18 19 import java.io.IOException ; 20 21 import javax.servlet.ServletInputStream ; 22 23 import org.apache.ajp.Ajp13; 24 25 public class Ajp13InputStream extends ServletInputStream { 26 27 private Ajp13 ajp13; 28 29 Ajp13InputStream(Ajp13 ajp13) { 30 this.ajp13 = ajp13; 31 } 32 33 public int available() throws IOException { 34 return ajp13.available(); 35 } 36 37 public void close() throws IOException { 38 } 39 40 public void mark(int readLimit) { 41 } 42 43 public boolean markSupported() { 44 return false; 45 } 46 47 public void reset() throws IOException { 48 throw new IOException ("reset() not supported"); 49 } 50 51 public int read() throws IOException { 52 return ajp13.doRead(); 53 } 54 55 public int read(byte[] b, int off, int len) throws IOException { 56 return ajp13.doRead(b, off, len); 57 } 58 59 public long skip(long n) throws IOException { 60 if (n > Integer.MAX_VALUE) { 61 throw new IOException ("can't skip than many: " + n); 62 } 63 byte[] b = new byte[(int)n]; 64 return ajp13.doRead(b, 0, b.length); 65 } 66 } 67 | Popular Tags |