Package org.apache.groovy.json.internal

## Class CharBuf

- java.lang.Object
- - java.io.Writer
  - - org.apache.groovy.json.internal.CharBuf

- All Implemented Interfaces:
    `java.io.Closeable`, `java.io.Flushable`, `java.lang.Appendable`, `java.lang.AutoCloseable`, `java.lang.CharSequence`

      public class CharBuf
      extends java.io.Writer
      implements java.lang.CharSequence

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected char[]` | `buffer` |
    `protected int` | `capacity` |
    `protected int` | `location` |

    - ### Fields inherited from class java.io.Writer

      `lock`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `CharBuf()` |
    `` | `CharBuf​(byte[] bytes)` |
    `` | `CharBuf​(char[] buffer)` |
    `protected` | `CharBuf​(int capacity)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `_len​(int location)` |
    `CharBuf` | `add​(boolean b)` |
    `CharBuf` | `add​(byte i)` |
    `CharBuf` | `add​(byte[] chars)` |
    `CharBuf` | `add​(byte[] bytes, int start, int end)` |
    `CharBuf` | `add​(char ch)` |
    `CharBuf` | `add​(char[] chars)` |
    `CharBuf` | `add​(char[] chars, int length)` |
    `CharBuf` | `add​(double d)` |
    `CharBuf` | `add​(float d)` |
    `CharBuf` | `add​(int i)` |
    `CharBuf` | `add​(long l)` |
    `CharBuf` | `add​(short i)` |
    `CharBuf` | `add​(java.lang.String str)` |
    `CharBuf` | `addBigDecimal​(java.math.BigDecimal key)` |
    `CharBuf` | `addBigInteger​(java.math.BigInteger key)` |
    `CharBuf` | `addBoolean​(boolean b)` |
    `CharBuf` | `addByte​(byte i)` |
    `CharBuf` | `addChar​(byte i)` |
    `CharBuf` | `addChar​(char ch)` |
    `CharBuf` | `addChar​(int i)` |
    `CharBuf` | `addChar​(short i)` |
    `CharBuf` | `addChars​(char[] chars)` |
    `CharBuf` | `addDouble​(double d)` |
    `CharBuf` | `addDouble​(java.lang.Double key)` |
    `CharBuf` | `addFloat​(float d)` |
    `CharBuf` | `addFloat​(java.lang.Float key)` |
    `CharBuf` | `addInt​(int i)` |
    `CharBuf` | `addInt​(java.lang.Integer key)` |
    `CharBuf` | `addJsonEscapedString​(char[] charArray)` |
    `CharBuf` | `addJsonEscapedString​(char[] charArray, boolean disableUnicodeEscaping)` |
    `CharBuf` | `addJsonEscapedString​(java.lang.String jsonString)` |
    `CharBuf` | `addJsonEscapedString​(java.lang.String jsonString, boolean disableUnicodeEscaping)` |
    `CharBuf` | `addJsonFieldName​(char[] chars)` |
    `CharBuf` | `addJsonFieldName​(char[] chars, boolean disableUnicodeEscaping)` |
    `CharBuf` | `addJsonFieldName​(java.lang.String str)` |
    `CharBuf` | `addJsonFieldName​(java.lang.String str, boolean disableUnicodeEscaping)` |
    `CharBuf` | `addLine​(java.lang.CharSequence str)` |
    `CharBuf` | `addLine​(java.lang.String str)` |
    `CharBuf` | `addLong​(long l)` |
    `CharBuf` | `addLong​(java.lang.Long key)` |
    `void` | `addNull()` |
    `CharBuf` | `addQuoted​(char[] chars)` |
    `CharBuf` | `addQuoted​(java.lang.String str)` |
    `CharBuf` | `addShort​(short i)` |
    `CharBuf` | `addString​(java.lang.String str)` |
    `byte` | `byteValue()` |
    `char` | `charAt​(int index)` |
    `void` | `close()` |
    `static CharBuf` | `create​(char[] buffer)` |
    `static CharBuf` | `create​(int capacity)` |
    `static CharBuf` | `createExact​(int capacity)` |
    `CharBuf` | `decodeJsonString​(char[] chars)` |
    `CharBuf` | `decodeJsonString​(char[] chars, int start, int to)` |
    `double` | `doubleValue()` |
    `float` | `floatValue()` |
    `void` | `flush()` |
    `void` | `init()` |
    `int` | `intValue()` |
    `int` | `len()` |
    `int` | `length()` |
    `long` | `longValue()` |
    `char[]` | `readForRecycle()` |
    `void` | `recycle()` |
    `void` | `removeLastChar()` |
    `void` | `removeLastChar​(char expect)` |
    `short` | `shortValue()` |
    `java.lang.CharSequence` | `subSequence​(int start, int end)` |
    `char[]` | `toCharArray()` |
    `java.lang.String` | `toDebugString()` |
    `java.lang.Number` | `toIntegerWrapper()` |
    `java.lang.String` | `toString()` |
    `java.lang.String` | `toStringAndRecycle()` |
    `void` | `write​(char[] cbuf, int off, int len)` |

    - ### Methods inherited from class java.io.Writer

      `append, append, append, nullWriter, write, write, write, write`

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

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

    - ### Methods inherited from interface java.lang.CharSequence

      `chars, codePoints`

- - ### Field Detail

    - #### capacity

          protected int capacity

    - #### location

          protected int location

    - #### buffer

          protected char[] buffer

  - ### Constructor Detail

    - #### CharBuf

          public CharBuf​(char[] buffer)

    - #### CharBuf

          public CharBuf​(byte[] bytes)

    - #### CharBuf

          protected CharBuf​(int capacity)

    - #### CharBuf

          protected CharBuf()

  - ### Method Detail

    - #### createExact

          public static CharBuf createExact​(int capacity)

    - #### create

          public static CharBuf create​(int capacity)

    - #### create

          public static CharBuf create​(char[] buffer)

    - #### write

          public void write​(char[] cbuf,
                            int off,
                            int len)

      Specified by:
        `write` in class `java.io.Writer`

    - #### flush

          public void flush()
                     throws java.io.IOException

      Specified by:
        `flush` in interface `java.io.Flushable`
      Specified by:
        `flush` in class `java.io.Writer`
      Throws:
        `java.io.IOException`

    - #### close

          public void close()
                     throws java.io.IOException

      Specified by:
        `close` in interface `java.lang.AutoCloseable`
      Specified by:
        `close` in interface `java.io.Closeable`
      Specified by:
        `close` in class `java.io.Writer`
      Throws:
        `java.io.IOException`

    - #### init

          public void init()

    - #### add

          public final CharBuf add​(java.lang.String str)

    - #### addString

          public final CharBuf addString​(java.lang.String str)

    - #### add

          public final CharBuf add​(int i)

    - #### addInt

          public final CharBuf addInt​(int i)

    - #### addInt

          public final CharBuf addInt​(java.lang.Integer key)

    - #### add

          public final CharBuf add​(boolean b)

    - #### addBoolean

          public final CharBuf addBoolean​(boolean b)

    - #### add

          public final CharBuf add​(byte i)

    - #### addByte

          public final CharBuf addByte​(byte i)

    - #### add

          public final CharBuf add​(short i)

    - #### addShort

          public final CharBuf addShort​(short i)

    - #### add

          public final CharBuf add​(long l)

    - #### add

          public final CharBuf add​(double d)

    - #### addDouble

          public final CharBuf addDouble​(double d)

    - #### addDouble

          public final CharBuf addDouble​(java.lang.Double key)

    - #### add

          public final CharBuf add​(float d)

    - #### addFloat

          public final CharBuf addFloat​(float d)

    - #### addFloat

          public final CharBuf addFloat​(java.lang.Float key)

    - #### addChar

          public final CharBuf addChar​(byte i)

    - #### addChar

          public final CharBuf addChar​(int i)

    - #### addChar

          public final CharBuf addChar​(short i)

    - #### addChar

          public final CharBuf addChar​(char ch)

    - #### addLine

          public CharBuf addLine​(java.lang.String str)

    - #### addLine

          public CharBuf addLine​(java.lang.CharSequence str)

    - #### add

          public CharBuf add​(char[] chars)

    - #### addChars

          public final CharBuf addChars​(char[] chars)

    - #### addQuoted

          public final CharBuf addQuoted​(char[] chars)

    - #### addJsonEscapedString

          public final CharBuf addJsonEscapedString​(java.lang.String jsonString)

    - #### addJsonEscapedString

          public final CharBuf addJsonEscapedString​(java.lang.String jsonString,
                                                    boolean disableUnicodeEscaping)

    - #### addJsonEscapedString

          public final CharBuf addJsonEscapedString​(char[] charArray)

    - #### addJsonEscapedString

          public final CharBuf addJsonEscapedString​(char[] charArray,
                                                    boolean disableUnicodeEscaping)

    - #### addJsonFieldName

          public final CharBuf addJsonFieldName​(java.lang.String str)

    - #### addJsonFieldName

          public final CharBuf addJsonFieldName​(java.lang.String str,
                                                boolean disableUnicodeEscaping)

    - #### addJsonFieldName

          public final CharBuf addJsonFieldName​(char[] chars)

    - #### addJsonFieldName

          public final CharBuf addJsonFieldName​(char[] chars,
                                                boolean disableUnicodeEscaping)

    - #### addQuoted

          public final CharBuf addQuoted​(java.lang.String str)

    - #### add

          public CharBuf add​(char[] chars,
                             int length)

    - #### add

          public CharBuf add​(byte[] chars)

    - #### add

          public CharBuf add​(byte[] bytes,
                             int start,
                             int end)

    - #### add

          public final CharBuf add​(char ch)

    - #### length

          public int length()

      Specified by:
        `length` in interface `java.lang.CharSequence`

    - #### charAt

          public char charAt​(int index)

      Specified by:
        `charAt` in interface `java.lang.CharSequence`

    - #### subSequence

          public java.lang.CharSequence subSequence​(int start,
                                                    int end)

      Specified by:
        `subSequence` in interface `java.lang.CharSequence`

    - #### toString

          public java.lang.String toString()

      Specified by:
        `toString` in interface `java.lang.CharSequence`
      Overrides:
        `toString` in class `java.lang.Object`

    - #### toDebugString

          public java.lang.String toDebugString()

    - #### toStringAndRecycle

          public java.lang.String toStringAndRecycle()

    - #### len

          public int len()

    - #### toCharArray

          public char[] toCharArray()

    - #### _len

          public void _len​(int location)

    - #### readForRecycle

          public char[] readForRecycle()

    - #### recycle

          public void recycle()

    - #### doubleValue

          public double doubleValue()

    - #### floatValue

          public float floatValue()

    - #### intValue

          public int intValue()

    - #### longValue

          public long longValue()

    - #### byteValue

          public byte byteValue()

    - #### shortValue

          public short shortValue()

    - #### toIntegerWrapper

          public java.lang.Number toIntegerWrapper()

    - #### addNull

          public final void addNull()

    - #### removeLastChar

          public void removeLastChar()

    - #### removeLastChar

          public void removeLastChar​(char expect)

    - #### addBigDecimal

          public CharBuf addBigDecimal​(java.math.BigDecimal key)

    - #### addBigInteger

          public CharBuf addBigInteger​(java.math.BigInteger key)

    - #### addLong

          public final CharBuf addLong​(long l)

    - #### addLong

          public final CharBuf addLong​(java.lang.Long key)

    - #### decodeJsonString

          public final CharBuf decodeJsonString​(char[] chars)

    - #### decodeJsonString

          public final CharBuf decodeJsonString​(char[] chars,
                                                int start,
                                                int to)