Source code: nanoxml/kXMLStringWriter.java
1 /* This file is part of NanoXML.
2 *
3 * $Revision: 1.1 $
4 * $Date: 2002/05/13 17:34:26 $
5 * $Name: build_20030502 $
6 *
7 * Copyright (C) 2000 Marc De Scheemaecker, All Rights Reserved.
8 *
9 * This software is provided 'as-is', without any express or implied warranty.
10 * In no event will the authors be held liable for any damages arising from the
11 * use of this software.
12 *
13 * Permission is granted to anyone to use this software for any purpose,
14 * including commercial applications, and to alter it and redistribute it
15 * freely, subject to the following restrictions:
16 *
17 * 1. The origin of this software must not be misrepresented; you must not
18 * claim that you wrote the original software. If you use this software in
19 * a product, an acknowledgment in the product documentation would be
20 * appreciated but is not required.
21 *
22 * 2. Altered source versions must be plainly marked as such, and must not be
23 * misrepresented as being the original software.
24 *
25 * 3. This notice may not be removed or altered from any source distribution.
26 */
27
28 package nanoxml;
29
30 import java.io.*;
31
32 public class kXMLStringWriter extends Writer
33 {
34 private StringBuffer buf;
35
36 /**
37 */
38
39 public kXMLStringWriter()
40 {
41 buf = new StringBuffer();
42 }
43
44 /**
45 */
46
47 public void close()
48 {
49 }
50
51 /**
52 */
53
54 public void flush()
55 {
56 }
57
58 /**
59 */
60
61 public void write( int c )
62 {
63 buf.append( (char) c );
64 }
65
66 /**
67 */
68
69 public void write( char b[], int off, int len )
70 {
71 buf.append( b, off, len );
72 }
73
74 /**
75 */
76
77 public void write( String str )
78 {
79 buf.append( str );
80 }
81
82 /**
83 */
84
85 public String toString()
86 {
87 return buf.toString();
88 }
89 }