Package groovy.json.internal

# Class CharBuf

java.lang.Object
java.io.Writer
groovy.json.internal.CharBuf

All Implemented Interfaces:
  `Closeable`, `Flushable`, `Appendable`, `AutoCloseable`, `CharSequence`

public class CharBuf extends Writer implements CharSequence

Author:
  Rick Hightower

## 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

Modifier and Type
Method
Description
`void`
`_len(int location)`
`final CharBuf`
`add(boolean b)`
`final CharBuf`
`add(byte i)`
`CharBuf`
`add(byte[] chars)`
`CharBuf`
`add(byte[] bytes, int start, int end)`
`final CharBuf`
`add(char ch)`
`CharBuf`
`add(char[] chars)`
`CharBuf`
`add(char[] chars, int length)`
`final CharBuf`
`add(double d)`
`final CharBuf`
`add(float d)`
`final CharBuf`
`add(int i)`
`final CharBuf`
`add(long l)`
`final CharBuf`
`add(short i)`
`final CharBuf`
`add(String str)`
`CharBuf`
`addBigDecimal(BigDecimal key)`
`CharBuf`
`addBigInteger(BigInteger key)`
`final CharBuf`
`addBoolean(boolean b)`
`final CharBuf`
`addByte(byte i)`
`final CharBuf`
`addChar(byte i)`
`final CharBuf`
`addChar(char ch)`
`final CharBuf`
`addChar(int i)`
`final CharBuf`
`addChar(short i)`
`final CharBuf`
`addChars(char[] chars)`
`final CharBuf`
`addDouble(double d)`
`final CharBuf`
`addDouble(Double key)`
`final CharBuf`
`addFloat(float d)`
`final CharBuf`
`addFloat(Float key)`
`final CharBuf`
`addInt(int i)`
`final CharBuf`
`addInt(Integer key)`
`final CharBuf`
`addJsonEscapedString(char[] charArray)`
`final CharBuf`
`addJsonEscapedString(String jsonString)`
`final CharBuf`
`addJsonFieldName(char[] chars)`
`final CharBuf`
`addJsonFieldName(String str)`
`CharBuf`
`addLine(CharSequence str)`
`CharBuf`
`addLine(String str)`
`final CharBuf`
`addLong(long l)`
`final CharBuf`
`addLong(Long key)`
`final void`
`addNull()`
`final CharBuf`
`addQuoted(char[] chars)`
`final CharBuf`
`addQuoted(String str)`
`final CharBuf`
`addShort(short i)`
`final CharBuf`
`addString(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)`
`final CharBuf`
`decodeJsonString(char[] chars)`
`final 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()`
`short`
`shortValue()`
`CharSequence`
`subSequence(int start, int end)`
`char[]`
`toCharArray()`
`String`
`toDebugString()`
`Number`
`toIntegerWrapper()`
`String`
`toString()`
`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, isEmpty`

## Field Details

### capacity

protected int capacity

### location

protected int location

### buffer

protected char[] buffer

## Constructor Details

### CharBuf

public CharBuf(char[] buffer)

### CharBuf

public CharBuf(byte[] bytes)

### CharBuf

protected CharBuf(int capacity)

### CharBuf

protected CharBuf()

## Method Details

### 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 `Writer`

### flush

public void flush() throws IOException

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

### close

public void close() throws IOException

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in class `Writer`
Throws:
  `IOException`

### init

public void init()

### add

public final CharBuf add(String str)

### addString

public final CharBuf addString(String str)

### add

public final CharBuf add(int i)

### addInt

public final CharBuf addInt(int i)

### addInt

public final CharBuf addInt(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(Double key)

### add

public final CharBuf add(float d)

### addFloat

public final CharBuf addFloat(float d)

### addFloat

public final CharBuf addFloat(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(String str)

### addLine

public CharBuf addLine(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(String jsonString)

### addJsonEscapedString

public final CharBuf addJsonEscapedString(char[] charArray)

### addJsonFieldName

public final CharBuf addJsonFieldName(String str)

### addJsonFieldName

public final CharBuf addJsonFieldName(char[] chars)

### addQuoted

public final CharBuf addQuoted(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 `CharSequence`

### charAt

public char charAt(int index)

Specified by:
  `charAt` in interface `CharSequence`

### subSequence

public CharSequence subSequence(int start, int end)

Specified by:
  `subSequence` in interface `CharSequence`

### toString

public String toString()

Specified by:
  `toString` in interface `CharSequence`
Overrides:
  `toString` in class `Object`

### toDebugString

public String toDebugString()

### toStringAndRecycle

public 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 Number toIntegerWrapper()

### addNull

public final void addNull()

### removeLastChar

public void removeLastChar()

### addBigDecimal

public CharBuf addBigDecimal(BigDecimal key)

### addBigInteger

public CharBuf addBigInteger(BigInteger key)

### addLong

public final CharBuf addLong(long l)

### addLong

public final CharBuf addLong(Long key)

### decodeJsonString

public final CharBuf decodeJsonString(char[] chars)

### decodeJsonString

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