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
Modifier and TypeFieldDescriptionprotected char[]
protected int
protected int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
_len
(int location) final CharBuf
add
(boolean b) final CharBuf
add
(byte i) add
(byte[] chars) add
(byte[] bytes, int start, int end) final CharBuf
add
(char ch) add
(char[] chars) 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
addBigDecimal
(BigDecimal key) 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
final CharBuf
addFloat
(float d) final CharBuf
final CharBuf
addInt
(int i) final CharBuf
final CharBuf
addJsonEscapedString
(char[] charArray) final CharBuf
addJsonEscapedString
(char[] charArray, boolean disableUnicodeEscaping) final CharBuf
addJsonEscapedString
(String jsonString) final CharBuf
addJsonEscapedString
(String jsonString, boolean disableUnicodeEscaping) final CharBuf
addJsonFieldName
(char[] chars) final CharBuf
addJsonFieldName
(char[] chars, boolean disableUnicodeEscaping) final CharBuf
addJsonFieldName
(String str) final CharBuf
addJsonFieldName
(String str, boolean disableUnicodeEscaping) addLine
(CharSequence str) final CharBuf
addLong
(long l) final CharBuf
final void
addNull()
final CharBuf
addQuoted
(char[] chars) final CharBuf
final CharBuf
addShort
(short i) final CharBuf
byte
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
float
void
flush()
void
init()
int
intValue()
int
len()
int
length()
long
char[]
void
recycle()
void
void
removeLastChar
(char expect) short
subSequence
(int start, int end) char[]
toString()
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
-