org.apache.tomcat.util.buf
public final class CharChunk extends Object implements Cloneable, Serializable, CharSequence
Nested Class Summary | |
---|---|
static interface | CharChunk.CharInputChannel |
static interface | CharChunk.CharOutputChannel
When we need more space we'll either
grow the buffer ( up to the limit ) or send it to a channel. |
Constructor Summary | |
---|---|
CharChunk()
Creates a new, uninitialized CharChunk object. | |
CharChunk(int size) |
Method Summary | |
---|---|
void | allocate(int initial, int limit) |
void | append(char b) |
void | append(CharChunk src) |
void | append(char[] src, int off, int len) Add data to the buffer |
void | append(StringBuffer sb) Add data to the buffer |
void | append(String s) Append a string to the buffer |
void | append(String s, int off, int len) Append a string to the buffer |
char | charAt(int index) |
boolean | equals(String s)
Compares the message bytes to the specified String object. |
boolean | equals(CharChunk cc) |
boolean | equals(char[] b2, int off2, int len2) |
boolean | equals(byte[] b2, int off2, int len2) |
boolean | equalsIgnoreCase(String s)
Compares the message bytes to the specified String object. |
void | flushBuffer() |
char[] | getBuffer() |
char[] | getChars() |
CharChunk | getClone() |
int | getEnd() |
int | getInt() |
int | getLength()
Returns the length of the bytes. |
int | getLimit() |
int | getOffset() |
int | getStart()
Returns the start offset of the bytes.
|
int | hash() |
int | hashIgnoreCase() |
int | indexOf(char c) |
int | indexOf(char c, int starting)
Returns true if the message bytes starts with the specified string. |
static int | indexOf(char[] chars, int off, int cend, char qq) |
int | indexOf(String src, int srcOff, int srcLen, int myOff) |
boolean | isNull() |
int | length() |
void | recycle()
Resets the message bytes to an uninitialized state. |
void | reset() |
void | setCharInputChannel(CharChunk.CharInputChannel in)
When the buffer is empty, read the data from the input channel. |
void | setCharOutputChannel(CharChunk.CharOutputChannel out) When the buffer is full, write the data to the output channel.
|
void | setChars(char[] c, int off, int len) |
void | setEnd(int i) |
void | setLimit(int limit) Maximum amount of data in this buffer.
|
void | setOffset(int off)
Returns the start offset of the bytes. |
void | setOptimizedWrite(boolean optimizedWrite) |
boolean | startsWith(String s)
Returns true if the message bytes starts with the specified string. |
boolean | startsWithIgnoreCase(String s, int pos)
Returns true if the message bytes starts with the specified string. |
int | substract() |
int | substract(CharChunk src) |
int | substract(char[] src, int off, int len) |
CharSequence | subSequence(int start, int end) |
String | toString() |
String | toStringInternal() |
Parameters: s the String to compare
Returns: true if the comparison succeeded, false otherwise
Parameters: s the String to compare
Returns: true if the comparison succeeded, false otherwise
Parameters: c the character
Parameters: s the string
Parameters: s the string