public class CharBuf extends PrintWriter implements CharSequence
| Modifier and Type | Field and Description |
|---|---|
protected char[] |
buffer |
protected int |
capacity |
protected static int |
DOUBLE_QUOTE |
protected static int |
ESCAPE |
protected static int |
FORWARD_SLASH |
protected static int |
LETTER_B |
protected static int |
LETTER_F |
protected static int |
LETTER_N |
protected static int |
LETTER_R |
protected static int |
LETTER_T |
protected static int |
LETTER_U |
protected int |
location |
out| Modifier | Constructor and Description |
|---|---|
protected |
CharBuf() |
|
CharBuf(byte[] bytes) |
|
CharBuf(char[] buffer) |
protected |
CharBuf(int capacity) |
| Modifier and Type | Method and 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(CharSequence str) |
CharBuf |
add(double d) |
CharBuf |
add(float d) |
CharBuf |
add(int i) |
CharBuf |
add(long l) |
CharBuf |
add(Object str) |
CharBuf |
add(short i) |
CharBuf |
add(String str) |
void |
addAsUTF(byte[] value) |
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 |
addCurrency(Currency key) |
CharBuf |
addDouble(double d) |
CharBuf |
addDouble(Double key) |
CharBuf |
addFloat(float d) |
CharBuf |
addFloat(Float key) |
CharSequence |
addHex(int decoded)
Turn a single bytes into two hex character representation.
|
CharBuf |
addInt(int i) |
CharBuf |
addInt(Integer key) |
CharBuf |
addJsonEscapedString(char[] charArray) |
CharBuf |
addJsonFieldName(char[] chars) |
CharBuf |
addJsonFieldName(String str) |
CharBuf |
addLine() |
CharBuf |
addLine(char[] chars) |
CharBuf |
addLine(CharSequence str) |
CharBuf |
addLine(Object str) |
CharBuf |
addLine(String str) |
CharBuf |
addLong(long l) |
CharBuf |
addLong(Long key) |
void |
addNull() |
CharBuf |
addObject(Object object) |
CharBuf |
addQuoted(char[] chars) |
CharBuf |
addQuoted(String str) |
CharBuf |
addShort(short i) |
CharBuf |
addString(String str) |
PrintWriter |
append(CharSequence csq) |
CharBuf |
asJsonString(String jsonString) |
byte |
byteValue() |
char |
charAt(int index) |
void |
close() |
static CharBuf |
create(char[] buffer) |
static CharBuf |
create(int capacity) |
static CharBuf |
createCharBuf() |
static CharBuf |
createCharBuf(int capacity) |
static CharBuf |
createExact(int capacity) |
static CharBuf |
createFromUTF8Bytes(byte[] buffer) |
CharBuf |
decodeJsonString(byte[] bytes,
int start,
int to) |
CharBuf |
decodeJsonString(char[] chars) |
CharBuf |
decodeJsonString(char[] chars,
int start,
int to) |
CharBuf |
decodeJsonStringAscii(byte[] bytes,
int start,
int to) |
void |
display() |
double |
doubleValue() |
protected static int |
encodeNibbleToHexAsciiCharByte(int nibble)
Turns a single nibble into an ascii HEX digit.
|
void |
ensure(int i) |
boolean |
equals(Object o) |
float |
floatValue() |
void |
flush() |
int |
hashCode() |
CharBuf |
indent(int i) |
void |
init() |
int |
intValue() |
void |
jsonDate(long millis) |
int |
len() |
int |
length() |
long |
longValue() |
CharBuf |
multiply(char c,
int len) |
CharBuf |
multiply(CharSequence str,
int len) |
void |
print(boolean b)
Prints a boolean value.
|
void |
print(char c)
Prints a character.
|
void |
print(char[] s)
Prints an array of characters.
|
void |
print(double d)
Prints a double-precision floating-point number.
|
void |
print(float f)
Prints a floating-point number.
|
void |
print(int i)
Prints an integer.
|
void |
print(long l)
Prints a long integer.
|
void |
print(Object obj)
Prints an object.
|
void |
print(String s)
Prints a string.
|
PrintWriter |
printf(Locale l,
String format,
Object... args)
A convenience method to write a formatted string to this writer using
the specified format string and arguments.
|
PrintWriter |
printf(String format,
Object... args)
A convenience method to write a formatted string to this writer using
the specified format string and arguments.
|
void |
println()
Terminates the current line by writing the line separator string.
|
void |
println(boolean x)
Prints a boolean value and then terminates the line.
|
void |
println(char x)
Prints a character and then terminates the line.
|
void |
println(char[] x)
Prints an array of characters and then terminates the line.
|
void |
println(double x)
Prints a double-precision floating-point number and then terminates the
line.
|
void |
println(float x)
Prints a floating-point number and then terminates the line.
|
void |
println(int x)
Prints an integer and then terminates the line.
|
void |
println(long x)
Prints a long integer and then terminates the line.
|
void |
println(Object object)
Prints a String and then terminates the line.
|
void |
println(String message)
Prints an Object and then terminates the line.
|
void |
puts(Object... messages) |
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) |
append, append, checkError, clearError, format, format, setError, write, write, write, writeprotected int capacity
protected int location
protected char[] buffer
protected static final int DOUBLE_QUOTE
protected static final int ESCAPE
protected static final int LETTER_N
protected static final int LETTER_U
protected static final int LETTER_T
protected static final int LETTER_R
protected static final int LETTER_B
protected static final int LETTER_F
protected static final int FORWARD_SLASH
public CharBuf(char[] buffer)
public CharBuf(byte[] bytes)
protected CharBuf(int capacity)
protected CharBuf()
public static CharBuf createExact(int capacity)
public static CharBuf create(int capacity)
public static CharBuf createCharBuf(int capacity)
public static CharBuf createCharBuf()
public static CharBuf create(char[] buffer)
public static CharBuf createFromUTF8Bytes(byte[] buffer)
public void write(char[] cbuf,
int off,
int len)
write in class PrintWriterpublic void flush()
flush in interface Flushableflush in class PrintWriterpublic void close()
close in interface Closeableclose in interface AutoCloseableclose in class PrintWriterpublic void init()
public final CharBuf add(CharSequence str)
public final CharBuf add(int i)
public final CharBuf addInt(int i)
public final CharBuf add(boolean b)
public final CharBuf addBoolean(boolean b)
public final CharBuf add(byte i)
public final CharBuf addByte(byte i)
public final CharBuf add(short i)
public final CharBuf addShort(short i)
public final CharBuf add(long l)
public final CharBuf add(double d)
public final CharBuf addDouble(double d)
public final CharBuf add(float d)
public final CharBuf addFloat(float d)
public final CharBuf addChar(byte i)
public final CharBuf addChar(int i)
public final CharBuf addChar(short i)
public final CharBuf addChar(char ch)
public final CharBuf add(char ch)
public CharBuf addLine()
public CharBuf addLine(char[] chars)
public CharBuf addLine(CharSequence str)
public CharBuf add(char[] chars)
public final CharBuf addChars(char[] chars)
public final CharBuf addQuoted(char[] chars)
public final CharBuf addJsonEscapedString(char[] charArray)
public final CharBuf addJsonFieldName(char[] chars)
public CharBuf add(char[] chars, int length)
public CharBuf add(byte[] chars)
public CharBuf add(byte[] bytes, int start, int end)
public int length()
length in interface CharSequencepublic char charAt(int index)
charAt in interface CharSequencepublic CharSequence subSequence(int start, int end)
subSequence in interface CharSequencepublic String toString()
toString in interface CharSequencetoString in class Objectpublic String toDebugString()
public String toStringAndRecycle()
public int len()
public char[] toCharArray()
public void _len(int location)
public char[] readForRecycle()
public void recycle()
public double doubleValue()
public float floatValue()
public int intValue()
public long longValue()
public byte byteValue()
public short shortValue()
public Number toIntegerWrapper()
public void addAsUTF(byte[] value)
public final void addNull()
public void removeLastChar()
public CharBuf addBigDecimal(BigDecimal key)
public CharBuf addBigInteger(BigInteger key)
public final CharBuf addLong(long l)
public CharSequence addHex(int decoded)
decoded - the byte to serializeObject.protected static int encodeNibbleToHexAsciiCharByte(int nibble)
nibble - the nibble to serializeObject.public final CharBuf decodeJsonString(char[] chars)
public final CharBuf decodeJsonString(char[] chars, int start, int to)
public final CharBuf decodeJsonString(byte[] bytes, int start, int to)
public final CharBuf decodeJsonStringAscii(byte[] bytes, int start, int to)
public void ensure(int i)
public CharBuf multiply(char c, int len)
public CharBuf multiply(CharSequence str, int len)
public void puts(Object... messages)
public void println(String message)
print(String) and then
println().println in class PrintWritermessage - The Object to be printed.public void println(Object object)
print(String) and then
println().println in class PrintWriterobject - the String value to be printedpublic CharBuf indent(int i)
public void jsonDate(long millis)
public PrintWriter append(CharSequence csq)
append in interface Appendableappend in class PrintWriterpublic void print(boolean b)
String.valueOf(boolean) is translated into bytes
according to the platform's default character encoding, and these bytes
are written in exactly the manner of the PrintWriter.write(int) method.print in class PrintWriterb - The boolean to be printedpublic void print(char c)
PrintWriter.write(int) method.print in class PrintWriterc - The char to be printedpublic void print(int i)
String.valueOf(int) is translated into bytes according
to the platform's default character encoding, and these bytes are
written in exactly the manner of the PrintWriter.write(int)
method.print in class PrintWriteri - The int to be printedInteger.toString(int)public void print(long l)
String.valueOf(long) is translated into bytes
according to the platform's default character encoding, and these bytes
are written in exactly the manner of the PrintWriter.write(int)
method.print in class PrintWriterl - The long to be printedLong.toString(long)public void print(float f)
String.valueOf(float) is translated into bytes
according to the platform's default character encoding, and these bytes
are written in exactly the manner of the PrintWriter.write(int)
method.print in class PrintWriterf - The float to be printedFloat.toString(float)public void print(double d)
String.valueOf(double) is translated into
bytes according to the platform's default character encoding, and these
bytes are written in exactly the manner of the PrintWriter.write(int) method.print in class PrintWriterd - The double to be printedDouble.toString(double)public void print(char[] s)
PrintWriter.write(int)
method.print in class PrintWriters - The array of chars to be printedNullPointerException - If s is nullpublic void print(String s)
null then the string
"null" is printed. Otherwise, the string's characters are
converted into bytes according to the platform's default character
encoding, and these bytes are written in exactly the manner of the
PrintWriter.write(int) method.print in class PrintWriters - The String to be printedpublic void print(Object obj)
String.valueOf(Object) method is translated into bytes
according to the platform's default character encoding, and these bytes
are written in exactly the manner of the PrintWriter.write(int)
method.print in class PrintWriterobj - The Object to be printedObject.toString()public void println()
line.separator, and is not necessarily a single newline
character ('\n').println in class PrintWriterpublic void println(boolean x)
print(boolean) and then
println().println in class PrintWriterx - the boolean value to be printedpublic void println(char x)
print(char) and then println().println in class PrintWriterx - the char value to be printedpublic void println(int x)
print(int) and then println().println in class PrintWriterx - the int value to be printedpublic void println(long x)
print(long) and then
println().println in class PrintWriterx - the long value to be printedpublic void println(float x)
print(float) and then
println().println in class PrintWriterx - the float value to be printedpublic void println(double x)
print(double) and then println().println in class PrintWriterx - the double value to be printedpublic void println(char[] x)
print(char[]) and then
println().println in class PrintWriterx - the array of char values to be printedpublic PrintWriter printf(String format, Object... args)
An invocation of this method of the form out.printf(format, args) behaves in exactly the same way as the invocation
out.format(format, args) printf in class PrintWriterformat - A format string as described in Format string syntax.args - Arguments referenced by the format specifiers in the format
string. If there are more arguments than format specifiers, the
extra arguments are ignored. The number of arguments is
variable and may be zero. The maximum number of arguments is
limited by the maximum dimension of a Java array as defined by
The Java™ Virtual Machine Specification.
The behaviour on a
null argument depends on the conversion.NullPointerException - If the format is nullpublic PrintWriter printf(Locale l, String format, Object... args)
An invocation of this method of the form out.printf(l, format, args) behaves in exactly the same way as the invocation
out.format(l, format, args) printf in class PrintWriterl - The locale to apply during
formatting. If l is null then no localization
is applied.format - A format string as described in Format string syntax.args - Arguments referenced by the format specifiers in the format
string. If there are more arguments than format specifiers, the
extra arguments are ignored. The number of arguments is
variable and may be zero. The maximum number of arguments is
limited by the maximum dimension of a Java array as defined by
The Java™ Virtual Machine Specification.
The behaviour on a
null argument depends on the conversion.NullPointerException - If the format is nullpublic void display()
Copyright © 2014. All rights reserved.