001: package org.methodize.nntprss.util;
002:
003: /* -----------------------------------------------------------
004: * nntp//rss - a bridge between the RSS world and NNTP clients
005: * Copyright (c) 2002, 2003 Jason Brome. All Rights Reserved.
006: *
007: * email: nntprss@methodize.org
008: * mail: Methodize Solutions
009: * PO Box 3865
010: * Grand Central Station
011: * New York NY 10163
012: *
013: * This file is part of nntp//rss
014: *
015: * nntp//rss is free software; you can redistribute it
016: * and/or modify it under the terms of the GNU General
017: * Public License as published by the Free Software Foundation;
018: * either version 2 of the License, or (at your option) any
019: * later version.
020: *
021: * This program is distributed in the hope that it will be
022: * useful, but WITHOUT ANY WARRANTY; without even the implied
023: * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
024: * PURPOSE. See the GNU General Public License for more
025: * details.
026: *
027: * You should have received a copy of the GNU General Public
028: * License along with this program; if not, write to the
029: * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
030: * Boston, MA 02111-1307 USA
031: * ----------------------------------------------------- */
032:
033: import java.io.OutputStream;
034: import java.io.PrintWriter;
035: import java.io.Writer;
036:
037: /**
038: *
039: * Wrapper class - used for output writer in NNTP communications
040: * All lines must end in CR/LF - if println is used in
041: * standard PrintWriter implementation, platform specific
042: * line termination will be used - e.g. \r\n *or* \n
043: *
044: * @author Jason Brome <jason@methodize.org>
045: * @version $Id: CRLFPrintWriter.java,v 1.3 2003/01/22 05:11:23 jasonbrome Exp $
046: */
047: public class CRLFPrintWriter extends PrintWriter {
048:
049: private static final String CRLF = "\r\n";
050:
051: public CRLFPrintWriter(OutputStream out) {
052: super (out);
053: }
054:
055: public CRLFPrintWriter(OutputStream out, boolean autoFlush) {
056: super (out, autoFlush);
057: }
058:
059: public CRLFPrintWriter(Writer out) {
060: super (out);
061: }
062:
063: public CRLFPrintWriter(Writer out, boolean autoFlush) {
064: super (out, autoFlush);
065: }
066:
067: /**
068: * @see java.io.PrintWriter#println()
069: */
070: public void println() {
071: super .print(CRLF);
072: }
073:
074: /**
075: * @see java.io.PrintWriter#println(boolean)
076: */
077: public void println(boolean arg0) {
078: super .print(arg0);
079: println();
080: }
081:
082: /**
083: * @see java.io.PrintWriter#println(char)
084: */
085: public void println(char arg0) {
086: super .print(arg0);
087: println();
088: }
089:
090: /**
091: * @see java.io.PrintWriter#println(char[])
092: */
093: public void println(char[] arg0) {
094: super .print(arg0);
095: println();
096: }
097:
098: /**
099: * @see java.io.PrintWriter#println(double)
100: */
101: public void println(double arg0) {
102: super .print(arg0);
103: println();
104: }
105:
106: /**
107: * @see java.io.PrintWriter#println(float)
108: */
109: public void println(float arg0) {
110: super .print(arg0);
111: println();
112: }
113:
114: /**
115: * @see java.io.PrintWriter#println(int)
116: */
117: public void println(int arg0) {
118: super .print(arg0);
119: println();
120: }
121:
122: /**
123: * @see java.io.PrintWriter#println(long)
124: */
125: public void println(long arg0) {
126: super .print(arg0);
127: println();
128: }
129:
130: /**
131: * @see java.io.PrintWriter#println(Object)
132: */
133: public void println(Object arg0) {
134: super .print(arg0);
135: println();
136: }
137:
138: /**
139: * @see java.io.PrintWriter#println(String)
140: */
141: public void println(String arg0) {
142: super.print(arg0);
143: println();
144: }
145:
146: }
|