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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected char[]protected intprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid_len(int location)add(boolean b)add(byte i)add(byte[] chars)add(byte[] bytes, int start, int end)add(char ch)add(char[] chars)add(char[] chars, int length)add(double d)add(float d)add(int i)add(long l)add(short i)addBigDecimal(BigDecimal key)addBigInteger(BigInteger key)addBoolean(boolean b)addByte(byte i)addChar(byte i)addChar(char ch)addChar(int i)addChar(short i)addChars(char[] chars)addDouble(double d)addFloat(float d)addInt(int i)addJsonEscapedString(char[] charArray)addJsonEscapedString(char[] charArray, boolean disableUnicodeEscaping)addJsonEscapedString(String jsonString)addJsonEscapedString(String jsonString, boolean disableUnicodeEscaping)addJsonFieldName(char[] chars)addJsonFieldName(char[] chars, boolean disableUnicodeEscaping)addJsonFieldName(String str)addJsonFieldName(String str, boolean disableUnicodeEscaping)addLine(CharSequence str)addLong(long l)voidaddNull()addQuoted(char[] chars)addShort(short i)bytecharcharAt(int index)voidclose()static CharBufcreate(char[] buffer)static CharBufcreate(int capacity)static CharBufcreateExact(int capacity)decodeJsonString(char[] chars)decodeJsonString(char[] chars, int start, int to)doublefloatvoidflush()voidinit()intintValue()intlen()intlength()longchar[]voidrecycle()voidvoidremoveLastChar(char expect)shortsubSequence(int start, int end)char[]toString()voidwrite(char[] cbuf, int off, int len)Methods inherited from class java.io.Writer
append, append, append, nullWriter, write, write, write, writeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
flushin interfaceFlushable- Specified by:
flushin classWriter- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein 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:
lengthin interfaceCharSequence
-
charAt
public char charAt(int index)- Specified by:
charAtin interfaceCharSequence
-
subSequence
- Specified by:
subSequencein interfaceCharSequence
-
toString
- Specified by:
toStringin interfaceCharSequence- Overrides:
toStringin 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
-