1 |
/* |
/* |
2 |
* $Id$ |
* ArticleStream.java |
3 |
* Copyright (C) 2002 The Free Software Foundation |
* Copyright (C) 2002 The Free Software Foundation |
4 |
* |
* |
5 |
* This file is part of GNU inetlib, a library. |
* This file is part of GNU inetlib, a library. |
46 |
* A stream that can be told to read to the end of its data. |
* A stream that can be told to read to the end of its data. |
47 |
* |
* |
48 |
* @author <a href='mailto:dog@gnu.org'>Chris Burdess</a> |
* @author <a href='mailto:dog@gnu.org'>Chris Burdess</a> |
|
* @version $Revision$ Date$ |
|
49 |
*/ |
*/ |
50 |
public final class ArticleStream |
public final class ArticleStream |
51 |
extends FilterInputStream implements PendingData |
extends FilterInputStream |
52 |
|
implements PendingData |
53 |
{ |
{ |
54 |
|
|
55 |
ArticleStream (InputStream in) |
ArticleStream(InputStream in) |
56 |
{ |
{ |
57 |
super (in); |
super(in); |
58 |
} |
} |
59 |
|
|
60 |
/** |
/** |
61 |
* Read to the end of the article data. |
* Read to the end of the article data. |
62 |
*/ |
*/ |
63 |
public void readToEOF () throws IOException |
public void readToEOF() |
64 |
|
throws IOException |
65 |
{ |
{ |
66 |
if (in.available () == 0) |
if (in.available() == 0) |
67 |
{ |
{ |
68 |
return; |
return; |
69 |
} |
} |
71 |
int ret = 0; |
int ret = 0; |
72 |
while (ret != -1) |
while (ret != -1) |
73 |
{ |
{ |
74 |
ret = in.read (buf); |
ret = in.read(buf); |
75 |
} |
} |
76 |
} |
} |
77 |
|
|
78 |
} |
} |
79 |
|
|