KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > lutris > appserver > server > httpPresentation > HttpPresentationInputStream


1
2 /*
3  * Enhydra Java Application Server Project
4  *
5  * The contents of this file are subject to the Enhydra Public License
6  * Version 1.1 (the "License"); you may not use this file except in
7  * compliance with the License. You may obtain a copy of the License on
8  * the Enhydra web site ( http://www.enhydra.org/ ).
9  *
10  * Software distributed under the License is distributed on an "AS IS"
11  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
12  * the License for the specific terms governing rights and limitations
13  * under the License.
14  *
15  * The Initial Developer of the Enhydra Application Server is Lutris
16  * Technologies, Inc. The Enhydra Application Server and portions created
17  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
18  * All Rights Reserved.
19  *
20  * Contributor(s):
21  *
22  * $Id: HttpPresentationInputStream.java,v 1.1 2005/07/13 11:09:06 slobodan Exp $
23  */

24
25
26
27
28
29 package com.lutris.appserver.server.httpPresentation;
30
31 import java.io.IOException JavaDoc;
32 import java.io.InputStream JavaDoc;
33
34
35 /**
36  * HTTP request input stream reader.
37  */

38 public abstract class HttpPresentationInputStream extends InputStream JavaDoc {
39
40     //FIX: Need MIME-read functions.
41

42     /**
43      * Starting at the specified offset, reads into the given array of
44      * bytes until all requested bytes have been read or a '\n' is
45      * encountered, in which case the '\n' is read into the array as well.
46      *
47      * @param b the buffer into which the data is read
48      * @param off the start offset of the data
49      * @param len the maximum number of bytes to read
50      * @return the actual number of bytes read, or -1 if the end of the
51      * stream is reached
52      * @exception IOException if an I/O error has occurred
53      */

54     public abstract int readLine(byte[] b, int off, int len)
55         throws IOException JavaDoc;
56
57
58     /*
59      * We disallow closing the input stream, but don't export the
60      * doc on this function so we don't confuse people.
61      */

62     public void close() throws IOException JavaDoc {
63         throw new HttpPresentationIOException("HttpPresentationInputStream may not be closed");
64     }
65 }
66
Popular Tags