2362N/A * Copyright (c) 1996, 2004, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * A character stream that collects its output in a string buffer, which can 0N/A * then be used to construct a string. 0N/A * Closing a <tt>StringWriter</tt> has no effect. The methods in this class 0N/A * can be called after the stream has been closed without generating an 0N/A * <tt>IOException</tt>. 0N/A * @author Mark Reinhold 0N/A * Create a new string writer using the default initial string-buffer 0N/A * Create a new string writer using the specified initial string-buffer 0N/A * @param initialSize 0N/A * The number of <tt>char</tt> values that will fit into this buffer 0N/A * before it is automatically expanded 0N/A * @throws IllegalArgumentException 0N/A * If <tt>initialSize</tt> is negative 0N/A * Write a single character. 0N/A * Write a portion of an array of characters. 0N/A * @param cbuf Array of characters 0N/A * @param off Offset from which to start writing characters 0N/A * @param len Number of characters to write 0N/A * Write a portion of a string. 0N/A * @param str String to be written 0N/A * @param off Offset from which to start writing characters 0N/A * @param len Number of characters to write 0N/A * Appends the specified character sequence to this writer. 0N/A * <p> An invocation of this method of the form <tt>out.append(csq)</tt> 0N/A * behaves in exactly the same way as the invocation 0N/A * out.write(csq.toString()) </pre> 0N/A * <p> Depending on the specification of <tt>toString</tt> for the 0N/A * character sequence <tt>csq</tt>, the entire sequence may not be 0N/A * appended. For instance, invoking the <tt>toString</tt> method of a 0N/A * character buffer will return a subsequence whose content depends upon 0N/A * the buffer's position and limit. 0N/A * The character sequence to append. If <tt>csq</tt> is 0N/A * <tt>null</tt>, then the four characters <tt>"null"</tt> are 0N/A * appended to this writer. 0N/A * @return This writer 0N/A * Appends a subsequence of the specified character sequence to this writer. 0N/A * <p> An invocation of this method of the form <tt>out.append(csq, start, 0N/A * end)</tt> when <tt>csq</tt> is not <tt>null</tt>, behaves in 0N/A * exactly the same way as the invocation 0N/A * out.write(csq.subSequence(start, end).toString()) </pre> 0N/A * The character sequence from which a subsequence will be 0N/A * appended. If <tt>csq</tt> is <tt>null</tt>, then characters 0N/A * will be appended as if <tt>csq</tt> contained the four 0N/A * characters <tt>"null"</tt>. 0N/A * The index of the first character in the subsequence 0N/A * The index of the character following the last character in the 0N/A * @return This writer 0N/A * @throws IndexOutOfBoundsException 0N/A * If <tt>start</tt> or <tt>end</tt> are negative, <tt>start</tt> 0N/A * is greater than <tt>end</tt>, or <tt>end</tt> is greater than 0N/A * <tt>csq.length()</tt> 0N/A * Appends the specified character to this writer. 0N/A * <p> An invocation of this method of the form <tt>out.append(c)</tt> 0N/A * behaves in exactly the same way as the invocation 0N/A * out.write(c) </pre> 0N/A * The 16-bit character to append 0N/A * @return This writer 0N/A * Return the buffer's current value as a string. 0N/A * Return the string buffer itself. 0N/A * @return StringBuffer holding the current buffer value. 0N/A * Closing a <tt>StringWriter</tt> has no effect. The methods in this 0N/A * class can be called after the stream has been closed without generating 0N/A * an <tt>IOException</tt>.