/[classpath]/classpath/java/io/OutputStreamWriter.java
ViewVC logotype

Diff of /classpath/java/io/OutputStreamWriter.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by mkoch, Mon Mar 24 07:27:52 2003 UTC revision 1.8 by mkoch, Mon Mar 24 10:19:19 2003 UTC
# Line 84  public class OutputStreamWriter extends Line 84  public class OutputStreamWriter extends
84    
85    /**    /**
86     * This method initializes a new instance of <code>OutputStreamWriter</code>     * This method initializes a new instance of <code>OutputStreamWriter</code>
    * to write to the specified stream using the default encoding.  
    *  
    * @param out The <code>OutputStream</code> to write to  
    */  
   public OutputStreamWriter(OutputStream out)  
   {  
     this.out = EncodingManager.getEncoder(out);  
   }  
   
   /**  
    * This method initializes a new instance of <code>OutputStreamWriter</code>  
87     * to write to the specified stream using a caller supplied character     * to write to the specified stream using a caller supplied character
88     * encoding scheme.  Note that due to a deficiency in the Java language     * encoding scheme.  Note that due to a deficiency in the Java language
89     * design, there is no way to determine which encodings are supported.     * design, there is no way to determine which encodings are supported.
# Line 113  public class OutputStreamWriter extends Line 102  public class OutputStreamWriter extends
102    }    }
103    
104    /**    /**
105     * This method closes this stream, and the underlying     * This method initializes a new instance of <code>OutputStreamWriter</code>
106     * <code>OutputStream</code>     * to write to the specified stream using the default encoding.
107     *     *
108     * @exception IOException If an error occurs     * @param out The <code>OutputStream</code> to write to
109     */     */
110    public void close() throws IOException    public OutputStreamWriter(OutputStream out)
111    {    {
112      out.close();      this.out = EncodingManager.getEncoder(out);
113    }    }
114    
115    /**    /**
116     * This method flushes any buffered bytes to the underlying output sink.     * This method closes this stream, and the underlying
117       * <code>OutputStream</code>
118     *     *
119     * @exception IOException If an error occurs     * @exception IOException If an error occurs
120     */     */
121    public void flush() throws IOException    public void close() throws IOException
122    {    {
123      out.flush();      out.close();
124    }    }
125    
126    /**    /**
# Line 146  public class OutputStreamWriter extends Line 136  public class OutputStreamWriter extends
136    }    }
137    
138    /**    /**
139     * This method writes a single character to the output stream.     * This method flushes any buffered bytes to the underlying output sink.
    *  
    * @param c The char to write, passed as an int.  
140     *     *
141     * @exception IOException If an error occurs     * @exception IOException If an error occurs
142     */     */
143    public void write(int c) throws IOException    public void flush() throws IOException
144    {    {
145      out.write(c);      out.flush();
146    }    }
147    
148    /**    /**
# Line 190  public class OutputStreamWriter extends Line 178  public class OutputStreamWriter extends
178      out.write(str, offset, len);      out.write(str, offset, len);
179    }    }
180    
181      /**
182       * This method writes a single character to the output stream.
183       *
184       * @param c The char to write, passed as an int.
185       *
186       * @exception IOException If an error occurs
187       */
188      public void write(int ch) throws IOException
189      {
190        out.write(ch);
191      }
192    
193  } // class OutputStreamWriter  } // class OutputStreamWriter
194    

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26