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) final CharBufadd(boolean b) final CharBufadd(byte i) add(byte[] chars) add(byte[] bytes, int start, int end) final CharBufadd(char ch) add(char[] chars) add(char[] chars, int length) final CharBufadd(double d) final CharBufadd(float d) final CharBufadd(int i) final CharBufadd(long l) final CharBufadd(short i) final CharBufaddBigDecimal(BigDecimal key) addBigInteger(BigInteger key) final CharBufaddBoolean(boolean b) final CharBufaddByte(byte i) final CharBufaddChar(byte i) final CharBufaddChar(char ch) final CharBufaddChar(int i) final CharBufaddChar(short i) final CharBufaddChars(char[] chars) final CharBufaddDouble(double d) final CharBuffinal CharBufaddFloat(float d) final CharBuffinal CharBufaddInt(int i) final CharBuffinal CharBufaddJsonEscapedString(char[] charArray) final CharBufaddJsonEscapedString(char[] charArray, boolean disableUnicodeEscaping) final CharBufaddJsonEscapedString(String jsonString) final CharBufaddJsonEscapedString(String jsonString, boolean disableUnicodeEscaping) final CharBufaddJsonFieldName(char[] chars) final CharBufaddJsonFieldName(char[] chars, boolean disableUnicodeEscaping) final CharBufaddJsonFieldName(String str) final CharBufaddJsonFieldName(String str, boolean disableUnicodeEscaping) addLine(CharSequence str) final CharBufaddLong(long l) final CharBuffinal voidaddNull()final CharBufaddQuoted(char[] chars) final CharBuffinal CharBufaddShort(short i) final CharBufbytecharcharAt(int index) voidclose()static CharBufcreate(char[] buffer) static CharBufcreate(int capacity) static CharBufcreateExact(int capacity) final CharBufdecodeJsonString(char[] chars) final CharBufdecodeJsonString(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
-