Package org.apache.groovy.json.internal
Class CharBuf
java.lang.Object
java.io.Writer
org.apache.groovy.json.internal.CharBuf
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
,CharSequence
public class CharBuf extends Writer implements CharSequence
-
Field Summary
-
Constructor Summary
-
Method Summary
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(String str)
CharBuf
addBigDecimal(BigDecimal key)
CharBuf
addBigInteger(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(Double key)
CharBuf
addFloat(float d)
CharBuf
addFloat(Float key)
CharBuf
addInt(int i)
CharBuf
addInt(Integer key)
CharBuf
addJsonEscapedString(char[] charArray)
CharBuf
addJsonEscapedString(char[] charArray, boolean disableUnicodeEscaping)
CharBuf
addJsonEscapedString(String jsonString)
CharBuf
addJsonEscapedString(String jsonString, boolean disableUnicodeEscaping)
CharBuf
addJsonFieldName(char[] chars)
CharBuf
addJsonFieldName(char[] chars, boolean disableUnicodeEscaping)
CharBuf
addJsonFieldName(String str)
CharBuf
addJsonFieldName(String str, boolean disableUnicodeEscaping)
CharBuf
addLine(CharSequence str)
CharBuf
addLine(String str)
CharBuf
addLong(long l)
CharBuf
addLong(Long key)
void
addNull()
CharBuf
addQuoted(char[] chars)
CharBuf
addQuoted(String str)
CharBuf
addShort(short i)
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)
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()
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
-
create
-
create
-
write
public void write(char[] cbuf, int off, int len) -
flush
- Specified by:
flush
in interfaceFlushable
- Specified by:
flush
in classWriter
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classWriter
- Throws:
IOException
-
init
public void init() -
add
-
addString
-
add
-
addInt
-
addInt
-
add
-
addBoolean
-
add
-
addByte
-
add
-
addShort
-
add
-
add
-
addDouble
-
addDouble
-
add
-
addFloat
-
addFloat
-
addChar
-
addChar
-
addChar
-
addChar
-
addLine
-
addLine
-
add
-
addChars
-
addQuoted
-
addJsonEscapedString
-
addJsonEscapedString
-
addJsonEscapedString
-
addJsonEscapedString
-
addJsonFieldName
-
addJsonFieldName
-
addJsonFieldName
-
addJsonFieldName
-
addQuoted
-
add
-
add
-
add
-
add
-
length
public int length()- Specified by:
length
in interfaceCharSequence
-
charAt
public char charAt(int index)- Specified by:
charAt
in interfaceCharSequence
-
subSequence
- Specified by:
subSequence
in interfaceCharSequence
-
toString
- Specified by:
toString
in interfaceCharSequence
- Overrides:
toString
in classObject
-
toDebugString
-
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
-
addNull
public final void addNull() -
removeLastChar
public void removeLastChar() -
removeLastChar
public void removeLastChar(char expect) -
addBigDecimal
-
addBigInteger
-
addLong
-
addLong
-
decodeJsonString
-
decodeJsonString
-