1 2 24 25 26 27 28 29 package com.lutris.appserver.server.httpPresentation.servlet; 30 31 import java.io.IOException ; 32 33 import javax.servlet.ServletInputStream ; 34 35 import com.lutris.appserver.server.httpPresentation.HttpPresentationIOException; 36 import com.lutris.appserver.server.httpPresentation.HttpPresentationInputStream; 37 38 46 public class ServletHttpPresentationInputStream 47 extends HttpPresentationInputStream { 48 private ServletInputStream inputStream; 49 50 53 protected ServletHttpPresentationInputStream(ServletInputStream inputStream) { 54 this.inputStream = inputStream; 55 } 56 57 68 public int readLine(byte[] b, int off, int len) 69 throws IOException { 70 try { 71 return inputStream.readLine(b, off, len); 72 } catch (IOException except) { 73 throw new HttpPresentationIOException(except); 74 } 75 } 76 77 80 public int read() throws IOException { 81 try { 82 return inputStream.read(); 83 } catch (IOException except) { 84 throw new HttpPresentationIOException(except); 85 } 86 } 87 88 public int read(byte b[]) throws IOException { 89 try { 90 return inputStream.read(b); 91 } catch (IOException except) { 92 throw new HttpPresentationIOException(except); 93 } 94 } 95 96 public int read(byte b[], int off, int len) throws IOException { 97 try { 98 return inputStream.read(b, off, len); 99 } catch (IOException except) { 100 throw new HttpPresentationIOException(except); 101 } 102 } 103 104 public long skip(long n) throws IOException { 105 try { 106 return inputStream.skip(n); 107 } catch (IOException except) { 108 throw new HttpPresentationIOException(except); 109 } 110 } 111 112 public int available() throws IOException { 113 try { 114 return inputStream.available(); 115 } catch (IOException except) { 116 throw new HttpPresentationIOException(except); 117 } 118 } 119 120 public synchronized void mark(int readlimit) { 121 inputStream.mark(readlimit); 122 } 123 124 public synchronized void reset() throws IOException { 125 try { 126 inputStream.reset(); 127 } catch (IOException except) { 128 throw new HttpPresentationIOException(except); 129 } 130 } 131 132 public boolean markSupported() { 133 return inputStream.markSupported(); 134 } 135 } 136 | Popular Tags |