org.apache.tomcat.util.buf
public final class CharChunk extends java.lang.Object implements java.lang.Cloneable, java.io.Serializable, java.lang.CharSequence
| Modifier and Type | Class and Description |
|---|---|
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 and Description |
|---|
CharChunk()
Creates a new, uninitialized CharChunk object.
|
CharChunk(int size) |
| Modifier and Type | Method and Description |
|---|---|
void |
allocate(int initial,
int limit) |
void |
append(char b) |
void |
append(char[] src,
int off,
int len)
Add data to the buffer
|
void |
append(CharChunk src) |
void |
append(java.lang.String s)
Append a string to the buffer
|
void |
append(java.lang.StringBuffer sb)
Add data to the buffer
|
void |
append(java.lang.String s,
int off,
int len)
Append a string to the buffer
|
char |
charAt(int index) |
boolean |
equals(byte[] b2,
int off2,
int len2) |
boolean |
equals(char[] b2,
int off2,
int len2) |
boolean |
equals(CharChunk cc) |
boolean |
equals(java.lang.String s)
Compares the message bytes to the specified String object.
|
boolean |
equalsIgnoreCase(java.lang.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) |
static int |
indexOf(char[] chars,
int off,
int cend,
char qq) |
int |
indexOf(char c,
int starting)
Returns true if the message bytes starts with the specified string.
|
int |
indexOf(java.lang.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(java.lang.String s)
Returns true if the message bytes starts with the specified string.
|
boolean |
startsWithIgnoreCase(java.lang.String s,
int pos)
Returns true if the message bytes starts with the specified string.
|
java.lang.CharSequence |
subSequence(int start,
int end) |
int |
substract() |
int |
substract(char[] src,
int off,
int len) |
int |
substract(CharChunk src) |
java.lang.String |
toString() |
java.lang.String |
toStringInternal() |
public CharChunk()
public CharChunk(int size)
public CharChunk getClone()
public boolean isNull()
public void recycle()
public void reset()
public void allocate(int initial,
int limit)
public void setOptimizedWrite(boolean optimizedWrite)
public void setChars(char[] c,
int off,
int len)
public void setLimit(int limit)
public int getLimit()
public void setCharInputChannel(CharChunk.CharInputChannel in)
public void setCharOutputChannel(CharChunk.CharOutputChannel out)
public char[] getChars()
public char[] getBuffer()
public int getStart()
public int getOffset()
public void setOffset(int off)
public int getLength()
public int getEnd()
public void setEnd(int i)
public void append(char b)
throws java.io.IOException
java.io.IOExceptionpublic void append(CharChunk src) throws java.io.IOException
java.io.IOExceptionpublic void append(char[] src,
int off,
int len)
throws java.io.IOException
java.io.IOExceptionpublic void append(java.lang.StringBuffer sb)
throws java.io.IOException
java.io.IOExceptionpublic void append(java.lang.String s)
throws java.io.IOException
java.io.IOExceptionpublic void append(java.lang.String s,
int off,
int len)
throws java.io.IOException
java.io.IOExceptionpublic int substract()
throws java.io.IOException
java.io.IOExceptionpublic int substract(CharChunk src) throws java.io.IOException
java.io.IOExceptionpublic int substract(char[] src,
int off,
int len)
throws java.io.IOException
java.io.IOExceptionpublic void flushBuffer()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String toString()
toString in interface java.lang.CharSequencetoString in class java.lang.Objectpublic java.lang.String toStringInternal()
public int getInt()
public boolean equals(java.lang.String s)
s - the String to comparepublic boolean equalsIgnoreCase(java.lang.String s)
s - the String to comparepublic boolean equals(CharChunk cc)
public boolean equals(char[] b2,
int off2,
int len2)
public boolean equals(byte[] b2,
int off2,
int len2)
public boolean startsWith(java.lang.String s)
s - the stringpublic boolean startsWithIgnoreCase(java.lang.String s,
int pos)
s - the stringpublic int hash()
public int hashIgnoreCase()
public int indexOf(char c)
public int indexOf(char c,
int starting)
c - the characterpublic static int indexOf(char[] chars,
int off,
int cend,
char qq)
public int indexOf(java.lang.String src,
int srcOff,
int srcLen,
int myOff)
public char charAt(int index)
charAt in interface java.lang.CharSequencepublic java.lang.CharSequence subSequence(int start,
int end)
subSequence in interface java.lang.CharSequencepublic int length()
length in interface java.lang.CharSequenceCopyright © 2000-2013 Apache Software Foundation. All Rights Reserved.