src/share/classes/java/io/CharArrayWriter.java

Print this page
rev 10048 : 8044740: Convert all JDK versions used in @since tag to 1.n[.n] in jdk repo
Reviewed-by:


  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.io;
  27 
  28 import java.util.Arrays;
  29 
  30 /**
  31  * This class implements a character buffer that can be used as an Writer.
  32  * The buffer automatically grows when data is written to the stream.  The data
  33  * can be retrieved using toCharArray() and toString().
  34  * <P>
  35  * Note: Invoking close() on this class has no effect, and methods
  36  * of this class can be called after the stream has closed
  37  * without generating an IOException.
  38  *
  39  * @author      Herb Jellinek
  40  * @since       JDK1.1
  41  */
  42 public
  43 class CharArrayWriter extends Writer {
  44     /**
  45      * The buffer where data is stored.
  46      */
  47     protected char buf[];
  48 
  49     /**
  50      * The number of chars in the buffer.
  51      */
  52     protected int count;
  53 
  54     /**
  55      * Creates a new CharArrayWriter.
  56      */
  57     public CharArrayWriter() {
  58         this(32);
  59     }
  60 




  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.io;
  27 
  28 import java.util.Arrays;
  29 
  30 /**
  31  * This class implements a character buffer that can be used as an Writer.
  32  * The buffer automatically grows when data is written to the stream.  The data
  33  * can be retrieved using toCharArray() and toString().
  34  * <P>
  35  * Note: Invoking close() on this class has no effect, and methods
  36  * of this class can be called after the stream has closed
  37  * without generating an IOException.
  38  *
  39  * @author      Herb Jellinek
  40  * @since       1.1
  41  */
  42 public
  43 class CharArrayWriter extends Writer {
  44     /**
  45      * The buffer where data is stored.
  46      */
  47     protected char buf[];
  48 
  49     /**
  50      * The number of chars in the buffer.
  51      */
  52     protected int count;
  53 
  54     /**
  55      * Creates a new CharArrayWriter.
  56      */
  57     public CharArrayWriter() {
  58         this(32);
  59     }
  60