CRLF Print Writer : Text Read Write « File Input Output « Java

Home
Java
1.2D Graphics GUI
2.3D
3.Advanced Graphics
4.Ant
5.Apache Common
6.Chart
7.Class
8.Collections Data Structure
9.Data Type
10.Database SQL JDBC
11.Design Pattern
12.Development Class
13.EJB3
14.Email
15.Event
16.File Input Output
17.Game
18.Generics
19.GWT
20.Hibernate
21.I18N
22.J2EE
23.J2ME
24.JavaFX
25.JDK 6
26.JDK 7
27.JNDI LDAP
28.JPA
29.JSP
30.JSTL
31.Language Basics
32.Network Protocol
33.PDF RTF
34.Reflection
35.Regular Expressions
36.Scripting
37.Security
38.Servlets
39.Spring
40.Swing Components
41.Swing JFC
42.SWT JFace Eclipse
43.Threads
44.Tiny Application
45.Velocity
46.Web Services SOA
47.XML
Java » File Input Output » Text Read Write 




CRLF Print Writer
      


/* -----------------------------------------------------------
 * nntp//rss - a bridge between the RSS world and NNTP clients
 * Copyright (c) 2002, 2003 Jason Brome.  All Rights Reserved.
 *
 * email: [email protected]
 * mail:  Methodize Solutions
 *        PO Box 3865
 *        Grand Central Station
 *        New York NY 10163
 
 * This file is part of nntp//rss
 
 * nntp//rss is free software; you can redistribute it 
 * and/or modify it under the terms of the GNU General 
 * Public License as published by the Free Software Foundation; 
 * either version 2 of the License, or (at your option) any 
 * later version.
 *
 * This program is distributed in the hope that it will be 
 * useful, but WITHOUT ANY WARRANTY; without even the implied 
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
 * PURPOSE.  See the GNU General Public License for more 
 * details.
 *
 * You should have received a copy of the GNU General Public 
 * License along with this program; if not, write to the 
 * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
 * Boston, MA  02111-1307  USA
 * ----------------------------------------------------- */

import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;

/**
 
 * Wrapper class - used for output writer in NNTP communications
 * All lines must end in CR/LF - if println is used in
 * standard PrintWriter implementation, platform specific
 * line termination will be used - e.g. \r\n *or* \n
 
 @author Jason Brome <[email protected]>
 @version $Id: CRLFPrintWriter.java,v 1.3 2003/01/22 05:11:23 jasonbrome Exp $
 */
public class CRLFPrintWriter extends PrintWriter {
  
  private static final String CRLF = "\r\n";
  
  public CRLFPrintWriter(OutputStream out) {
    super(out);
  }
  
  public CRLFPrintWriter(OutputStream out, boolean autoFlush) {
    super(out, autoFlush);
  }

  public CRLFPrintWriter(Writer out) {
    super(out);
  }
  
  public CRLFPrintWriter(Writer out, boolean autoFlush) {
    super(out, autoFlush);
  }
  
  

  /**
   @see java.io.PrintWriter#println()
   */
  public void println() {
    super.print(CRLF);
  }

  /**
   @see java.io.PrintWriter#println(boolean)
   */
  public void println(boolean arg0) {
    super.print(arg0);
    println();
  }

  /**
   @see java.io.PrintWriter#println(char)
   */
  public void println(char arg0) {
    super.print(arg0);
    println();
  }

  /**
   @see java.io.PrintWriter#println(char[])
   */
  public void println(char[] arg0) {
    super.print(arg0);
    println();
  }

  /**
   @see java.io.PrintWriter#println(double)
   */
  public void println(double arg0) {
    super.print(arg0);
    println();
  }

  /**
   @see java.io.PrintWriter#println(float)
   */
  public void println(float arg0) {
    super.print(arg0);
    println();
  }

  /**
   @see java.io.PrintWriter#println(int)
   */
  public void println(int arg0) {
    super.print(arg0);
    println();
  }

  /**
   @see java.io.PrintWriter#println(long)
   */
  public void println(long arg0) {
    super.print(arg0);
    println();
  }

  /**
   @see java.io.PrintWriter#println(Object)
   */
  public void println(Object arg0) {
    super.print(arg0);
    println();
  }

  /**
   @see java.io.PrintWriter#println(String)
   */
  public void println(String arg0) {
    super.print(arg0);
    println();
  }

}

   
    
    
    
    
    
  














Related examples in the same category
1.Data Text Writer
2.Load File As Text
3.Load file content to List
4.Load file line by line
5.Java File Generator
6.Writing delimited text data to a file or a stream
7.Searches case sensitively in a file
8.To Hex String and char
9.CRLF Terminated Reader
10.Find a pattern within a file
11.Gets the content from a File as String Array List
12.Dump a String to a text file with encoding.
13.Load a text file contents as a String.
14.An iterator that breaks text into lines. The result is equal to BufferedReader.readLine().
15.Compare text file line by lineCompare text file line by line
16.Read and return the entire contents of the supplied File.
17.Allows reading and writing to a plain text file via a list of lines.Allows reading and writing to a plain text file via a list of lines.
18.Text File Handler
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.