org.json.me
Class StringWriter

java.lang.Object
  extended by java.io.Writer
      extended by org.json.me.StringWriter

public class StringWriter
extends Writer

A simple StringBuffer-based implementation of StringWriter

Since:
BlackBerry API 6.0.0

Field Summary
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
StringWriter()
           
StringWriter(int initialSize)
           
 
Method Summary
 void close()
          Close the stream, flushing it first.
 void flush()
          Flush the stream.
 void write(char[] cbuf, int off, int len)
          Write a portion of an array of characters.
 void write(String str)
          Write a string.
 void write(String str, int off, int len)
          Write a portion of a string.
 
Methods inherited from class java.io.Writer
write, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Constructor Detail

StringWriter

public StringWriter()
Since:
BlackBerry API 6.0.0

StringWriter

public StringWriter(int initialSize)
Since:
BlackBerry API 6.0.0


Method Detail

write

public void write(char[] cbuf,
                  int off,
                  int len)
           throws IOException
Description copied from class: Writer
Write a portion of an array of characters.

Specified by:
write in class Writer
Parameters:
cbuf - Array of characters
off - Offset from which to start writing characters
len - Number of characters to write
Throws:
IOException - If an I/O error occurs
Since:
BlackBerry API 6.0.0

write

public void write(String str)
           throws IOException
Description copied from class: Writer
Write a string.

Overrides:
write in class Writer
Parameters:
str - String to be written
Throws:
IOException - If an I/O error occurs
Since:
BlackBerry API 6.0.0

write

public void write(String str,
                  int off,
                  int len)
           throws IOException
Description copied from class: Writer
Write a portion of a string.

Overrides:
write in class Writer
Parameters:
str - A String
off - Offset from which to start writing characters
len - Number of characters to write
Throws:
IOException - If an I/O error occurs
Since:
BlackBerry API 6.0.0

flush

public void flush()
           throws IOException
Description copied from class: Writer
Flush the stream. If the stream has saved any characters from the various write() methods in a buffer, write them immediately to their intended destination. Then, if that destination is another character or byte stream, flush it. Thus one flush() invocation will flush all the buffers in a chain of Writers and OutputStreams.

Specified by:
flush in class Writer
Throws:
IOException - If an I/O error occurs
Since:
BlackBerry API 6.0.0

close

public void close()
           throws IOException
Description copied from class: Writer
Close the stream, flushing it first. Once a stream has been closed, further write() or flush() invocations will cause an IOException to be thrown. Closing a previously-closed stream, however, has no effect.

Specified by:
close in class Writer
Throws:
IOException - If an I/O error occurs
Since:
BlackBerry API 6.0.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.