Overview | Package | Class | Deprecated | Index | Help
| Groovy 1.7.0
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.groovy.runtime
Class StringBufferWriter

    java.lang.Object
      java.io.Writer
          org.codehaus.groovy.runtime.StringBufferWriter

    class StringBufferWriter
    extends Writer

This class codes around a silly limiation of StringWriter which doesn't allow a StringBuffer to be passed in as a constructor for some bizzare reason. So we replicate the behaviour of StringWriter here but allow a StringBuffer to be passed in.

author:
  James Strachan

version:
  $Revision: 6778 $

Constructor Summary
`StringBufferWriter(StringBuffer buffer)` Create a new string writer which will append the text to the given StringBuffer

Method Summary
`void` | `close()` Closing a `StringWriter` has no effect.
`void` | `flush()` Flush the stream.
`String` | `toString()` Return the buffer's current value as a string.
`void` | `write(int c)` Write a single character.
`void` | `write(char[] text, int offset, int length)` Write a portion of an array of characters.
`void` | `write(String text)` Write a string.
`void` | `write(String text, int offset, int length)` Write a portion of a string.

Methods inherited from class Writer
append, append, append, append, append, append, write, write, write, write, write, close, flush, wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll

Methods inherited from class Object
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll

Constructor Detail

### StringBufferWriter

    public StringBufferWriter(StringBuffer buffer)

  Create a new string writer which will append the text to the given StringBuffer

Method Detail

### close

    public void close()

  Closing a `StringWriter` has no effect. The methods in this class can be called after the stream has been closed without generating an `IOException`.

### flush

    public void flush()

  Flush the stream.

### toString

    public String toString()

  Return the buffer's current value as a string.

### write

    public void write(int c)

  Write a single character.

### write

    public void write(char[] text, int offset, int length)

  Write a portion of an array of characters.
  param:
    text Array of characters
  param:
    offset Offset from which to start writing characters
  param:
    length Number of characters to write

### write

    public void write(String text)

  Write a string.

### write

    public void write(String text, int offset, int length)

  Write a portion of a string.
  param:
    text the text to be written
  param:
    offset offset from which to start writing characters
  param:
    length Number of characters to write

Copyright © 2003-2009 The Codehaus. All rights reserved.