Package java.io
Class StringWriter

Public Method write

void write(char[] buf, int offset, int len)

Overrides:

void write(int c)

Overrides:

void write(String str)

Overrides:

void write(String str, int offset, int len)

Overrides:

_INSERT_METHOD_SIGNATURE_HERE_

Description:

write(char[] buf, int offset, int len) method:

This method writes a portion of an array of characters.

write(int c) method:

This method writes a single character.

write(String str) method:

This method writes a whole string.

write(String str, int offset, int len) method:

This method is used to write a portion of a string.

Example

   StringWriter sw = new StringWriter();
   char[] ch = {10,20};
   sw.write(ch, 0, 2);

The example above writes the character array to the String output stream.