de.vc.util

## Class CharBuffer

- java.lang.Object
- - de.vc.util.CharBuffer

-     public class CharBuffer
      extends java.lang.Object

  A char buffer is a little bit similar to a StringBuffer but can be reseted to reuse the internal char-array.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CharBuffer()`
    `CharBuffer(int capacity)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `append(char c)` Appends a character to this buffer.
    `void` | `append(int b, java.lang.String encoding)` Appends a character to this buffer.
    `void` | `append(java.lang.String text)` Appends a string to this buffer.
    `void` | `reset()` Resets the size to zero.
    `void` | `reset(int maxBufferSize)` Resets the size to zero and ensures that buffers size (internal `char[]`) is not larger then `maxBufferSize`.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### CharBuffer

          public CharBuffer()

    - #### CharBuffer

          public CharBuffer(int capacity)

  - ### Method Detail

    - #### append

          public void append(char c)

      Appends a character to this buffer.
      Parameters:
        `c` - Character.

    - #### append

          public void append(int b,
                    java.lang.String encoding)
                      throws java.io.UnsupportedEncodingException

      Appends a character to this buffer.
      Parameters:
        `b` - Byte of character.
        `encoding` - Encoding of byte.
      Throws:
        `java.io.UnsupportedEncodingException`

    - #### append

          public void append(java.lang.String text)

      Appends a string to this buffer.
      Parameters:
        `text` - String.

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### reset

          public void reset()

      Resets the size to zero.

    - #### reset

          public void reset(int maxBufferSize)

      Resets the size to zero and ensures that buffers size (internal `char[]`) is not larger then `maxBufferSize`.
      Parameters:
        `maxBufferSize` - Maximum size of buffer after reset.

© 2003-2011 by Sascha Schmidt (vision-cloud.de). All Rights Reserved.