01: /*
02: * Enhydra Java Application Server Project
03: *
04: * The contents of this file are subject to the Enhydra Public License
05: * Version 1.1 (the "License"); you may not use this file except in
06: * compliance with the License. You may obtain a copy of the License on
07: * the Enhydra web site ( http://www.enhydra.org/ ).
08: *
09: * Software distributed under the License is distributed on an "AS IS"
10: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11: * the License for the specific terms governing rights and limitations
12: * under the License.
13: *
14: * The Initial Developer of the Enhydra Application Server is Lutris
15: * Technologies, Inc. The Enhydra Application Server and portions created
16: * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17: * All Rights Reserved.
18: *
19: * Contributor(s):
20: *
21: * $Id: HttpPresentationInputStream.java,v 1.2 2006-06-15 13:40:47 sinisa Exp $
22: */
23:
24: package com.lutris.appserver.server.httpPresentation;
25:
26: import java.io.IOException;
27: import java.io.InputStream;
28:
29: /**
30: * HTTP request input stream reader.
31: */
32: public abstract class HttpPresentationInputStream extends InputStream {
33:
34: //FIX: Need MIME-read functions.
35:
36: /**
37: * Starting at the specified offset, reads into the given array of
38: * bytes until all requested bytes have been read or a '\n' is
39: * encountered, in which case the '\n' is read into the array as well.
40: *
41: * @param b the buffer into which the data is read
42: * @param off the start offset of the data
43: * @param len the maximum number of bytes to read
44: * @return the actual number of bytes read, or -1 if the end of the
45: * stream is reached
46: * @exception IOException if an I/O error has occurred
47: */
48: public abstract int readLine(byte[] b, int off, int len)
49: throws IOException;
50:
51: /*
52: * We disallow closing the input stream, but don't export the
53: * doc on this function so we don't confuse people.
54: */
55: public void close() throws IOException {
56: throw new HttpPresentationIOException(
57: "HttpPresentationInputStream may not be closed");
58: }
59: }
|