KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gnu > mail > util > MimeMultipartInputStream


1 /*
2  * MimeMultipartInputStream.java
3  * Copyright (C) 2003 Doug Porter
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * You also have permission to link it with the Sun Microsystems, Inc.
11  * JavaMail(tm) extension and run that combination.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21  */

22
23 package gnu.mail.util;
24
25 import java.io.PushbackInputStream JavaDoc;
26 import java.io.InputStream JavaDoc;
27 import java.io.IOException JavaDoc;
28
29 import gnu.mail.util.LineInputStream;
30
31 /**
32  * An input stream specifically for MimeMultipart.
33  * <p>
34  * This temporary kludge is just until we can eliminate the use of PushbackInputStream
35  * from MimeMultipart. This class blends the capabilities of PushbackInputStream and
36  * LineInputStream.
37  * <p>
38  * As soon as we rewrite MimeMultipart we can use LineInputStream
39  * or MessageInputStream directly in MimeMultipart.
40  *
41  * @author Doug Porter
42  */

43 public class MimeMultipartInputStream
44   extends PushbackInputStream JavaDoc
45 {
46     private LineInputStream lineIn;
47     
48     /**
49     * Constructor.
50     */

51     public MimeMultipartInputStream (InputStream JavaDoc in)
52     {
53         super (in);
54         lineIn = new LineInputStream (this);
55     }
56   
57     
58     /** Read the next line of text without character encoding.
59      *
60      * This method simply calls LineInputStream.readLine.
61      *
62      * @return line read, or null on end of stream.
63      */

64     public String JavaDoc readLine ()
65     throws IOException JavaDoc {
66         
67         return lineIn.readLine ();
68         
69     }
70 }
71
Popular Tags