src/org/sonews/util/io/ArticleInputStream.java
changeset 62 be4e87479855
parent 37 74139325d305
     1.1 --- a/src/org/sonews/util/io/ArticleInputStream.java	Sun Aug 29 18:17:37 2010 +0200
     1.2 +++ b/src/org/sonews/util/io/ArticleInputStream.java	Wed Sep 14 23:25:00 2011 +0200
     1.3 @@ -15,7 +15,6 @@
     1.4   *   You should have received a copy of the GNU General Public License
     1.5   *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
     1.6   */
     1.7 -
     1.8  package org.sonews.util.io;
     1.9  
    1.10  import java.io.ByteArrayOutputStream;
    1.11 @@ -29,15 +28,13 @@
    1.12   * @author Christian Lins
    1.13   * @since sonews/0.5.0
    1.14   */
    1.15 -public class ArticleInputStream extends InputStream
    1.16 -{
    1.17 +public class ArticleInputStream extends InputStream {
    1.18  
    1.19  	private byte[] buf;
    1.20  	private int pos = 0;
    1.21  
    1.22  	public ArticleInputStream(final Article art)
    1.23 -		throws IOException, UnsupportedEncodingException
    1.24 -	{
    1.25 +			throws IOException, UnsupportedEncodingException {
    1.26  		final ByteArrayOutputStream out = new ByteArrayOutputStream();
    1.27  		out.write(art.getHeaderSource().getBytes("UTF-8"));
    1.28  		out.write("\r\n\r\n".getBytes());
    1.29 @@ -56,8 +53,7 @@
    1.30  	 * @return The byte read, or -1 if end of stream
    1.31  	 */
    1.32  	@Override
    1.33 -	public synchronized int read()
    1.34 -	{
    1.35 +	public synchronized int read() {
    1.36  		if (pos < buf.length) {
    1.37  			return ((int) buf[pos++]) & 0xFF;
    1.38  		} else {