001/* ----------------------------------------------------------------------------
002   The Kiwi Toolkit - A Java Class Library
003   Copyright (C) 1998-2004 Mark A. Lindner
004
005   This library is free software; you can redistribute it and/or
006   modify it under the terms of the GNU General Public License as
007   published by the Free Software Foundation; either version 2 of the
008   License, or (at your option) any later version.
009
010   This library is distributed in the hope that it will be useful,
011   but WITHOUT ANY WARRANTY; without even the implied warranty of
012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013   General Public License for more details.
014
015   You should have received a copy of the GNU General Public License
016   along with this library; if not, write to the Free Software
017   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
018   02111-1307, USA.
019 
020   The author may be contacted at: mark_a_lindner@yahoo.com
021   ----------------------------------------------------------------------------
022   $Log: XDataOutputStream.java,v $
023   Revision 1.6  2004/05/05 21:36:35  markl
024   comment block updates
025
026   Revision 1.5  2004/03/15 05:46:37  markl
027   javadoc typo fix
028
029   Revision 1.4  2003/01/19 09:37:12  markl
030   Javadoc & comment header updates.
031
032   Revision 1.3  2001/03/12 01:58:43  markl
033   Source code cleanup.
034
035   Revision 1.2  1999/01/10 03:34:00  markl
036   added GPL header & RCS tag
037   ----------------------------------------------------------------------------
038*/
039
040package kiwi.io;
041
042import java.io.*;
043
044/** This class is a trivial extension of <code>DataOutputStream</code> that
045 * implements a <code>putLine()</code> method to complement the
046  * <code>getLine()</code> method in <code>XDataInputStream</code>.
047  *
048  * @author Mark Lindner
049  *
050  * @see java.io.DataInputStream
051  * @see kiwi.io.XDataInputStream
052  */
053
054
055public class XDataOutputStream extends DataOutputStream
056  {
057
058  /** Construct a new <code>XDataOutputStream</code>.
059    *
060    * @param out The <code>OutputStream</code> to wrap.
061    */
062
063  public XDataOutputStream(OutputStream out)
064    {
065    super(out);
066    }
067
068  /** Write a string and a CR+LF pair to the stream, and flush
069    * the stream.
070    *
071    * @param s The string to write.
072    */
073
074  public void putLine(String s) throws IOException
075    {
076    writeBytes(s);
077    writeBytes("\r\n");
078    flush();
079    }
080  
081  }
082
083/* end of source file */