commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject cvs commit: jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/io BeanWriter.java
Date Fri, 11 Apr 2003 21:47:13 GMT
rdonkin     2003/04/11 14:47:13

  Modified:    betwixt/src/java/org/apache/commons/betwixt/io
                        BeanWriter.java
  Log:
  Added constructor which allows the encoding type to be set. Suggested by Kevin Ho.
  
  Revision  Changes    Path
  1.17      +14 -0     jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/io/BeanWriter.java
  
  Index: BeanWriter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/io/BeanWriter.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- BeanWriter.java	4 Mar 2003 21:48:10 -0000	1.16
  +++ BeanWriter.java	11 Apr 2003 21:47:12 -0000	1.17
  @@ -62,6 +62,7 @@
   package org.apache.commons.betwixt.io;
   
   import java.beans.IntrospectionException;
  +import java.io.UnsupportedEncodingException;
   import java.io.BufferedWriter;
   import java.io.IOException;
   import java.io.OutputStream;
  @@ -160,6 +161,19 @@
        */
       public BeanWriter(OutputStream out) {
           this.writer = new BufferedWriter( new OutputStreamWriter( out ) );
  +        this.autoFlush = true;
  +    }
  +
  +    /**
  +     * <p>Constuctor uses given <code>OutputStream</code> for output

  +     * and allows encoding to be set.</p>
  +     *
  +     * @param out write out representations to this stream
  +     * @param end the name of the encoding to be used. This should be compatible
  +     * with the encoding types described in <code>java.io</code>
  +     */
  +    public BeanWriter(OutputStream out, String enc) throws UnsupportedEncodingException
{
  +        this.writer = new BufferedWriter( new OutputStreamWriter( out, enc ) );
           this.autoFlush = true;
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message