Home » apache-tomcat-6.0.26-src » org.apache » tomcat » util » buf » [javadoc | source]
org.apache.tomcat.util.buf
public final class: CharChunk [javadoc | source]
java.lang.Object
   org.apache.tomcat.util.buf.CharChunk

All Implemented Interfaces:
    CharSequence, Cloneable, Serializable

Utilities to manipluate char chunks. While String is the easiest way to manipulate chars ( search, substrings, etc), it is known to not be the most efficient solution - Strings are designed as imutable and secure objects.
Nested Class Summary:
public static interface  CharChunk.CharInputChannel   
public 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:
 public CharChunk() 
 public CharChunk(int size) 
Method from org.apache.tomcat.util.buf.CharChunk Summary:
allocate,   append,   append,   append,   append,   append,   append,   charAt,   equals,   equals,   equals,   equals,   equalsIgnoreCase,   flushBuffer,   getBuffer,   getChars,   getClone,   getEnd,   getInt,   getLength,   getLimit,   getOffset,   getStart,   hash,   hashIgnoreCase,   indexOf,   indexOf,   indexOf,   indexOf,   isNull,   length,   recycle,   reset,   setCharInputChannel,   setCharOutputChannel,   setChars,   setEnd,   setLimit,   setOffset,   setOptimizedWrite,   startsWith,   startsWithIgnoreCase,   subSequence,   substract,   substract,   substract,   toString,   toStringInternal
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tomcat.util.buf.CharChunk Detail:
 public  void allocate(int initial,
    int limit) 
 public  void append(char b) throws IOException 
 public  void append(CharChunk src) throws IOException 
 public  void append(StringBuffer sb) throws IOException 
    Add data to the buffer
 public  void append(String s) throws IOException 
    Append a string to the buffer
 public  void append(char[] src,
    int off,
    int len) throws IOException 
    Add data to the buffer
 public  void append(String s,
    int off,
    int len) throws IOException 
    Append a string to the buffer
 public char charAt(int index) 
 public boolean equals(String s) 
    Compares the message bytes to the specified String object.
 public boolean equals(CharChunk cc) 
 public boolean equals(char[] b2,
    int off2,
    int len2) 
 public boolean equals(byte[] b2,
    int off2,
    int len2) 
 public boolean equalsIgnoreCase(String s) 
    Compares the message bytes to the specified String object.
 public  void flushBuffer() throws IOException 
 public char[] getBuffer() 
 public char[] getChars() 
 public CharChunk getClone() 
 public int getEnd() 
 public int getInt() 
 public int getLength() 
    Returns the length of the bytes.
 public int getLimit() 
 public int getOffset() 
 public int getStart() 
    Returns the start offset of the bytes. For output this is the end of the buffer.
 public int hash() 
 public int hashIgnoreCase() 
 public int indexOf(char c) 
 public int indexOf(char c,
    int starting) 
    Returns true if the message bytes starts with the specified string.
 public static int indexOf(char[] chars,
    int off,
    int cend,
    char qq) 
 public int indexOf(String src,
    int srcOff,
    int srcLen,
    int myOff) 
 public boolean isNull() 
 public int length() 
 public  void recycle() 
    Resets the message bytes to an uninitialized state.
 public  void reset() 
 public  void setCharInputChannel(CharInputChannel in) 
    When the buffer is empty, read the data from the input channel.
 public  void setCharOutputChannel(CharOutputChannel out) 
    When the buffer is full, write the data to the output channel. Also used when large amount of data is appended. If not set, the buffer will grow to the limit.
 public  void setChars(char[] c,
    int off,
    int len) 
 public  void setEnd(int i) 
 public  void setLimit(int limit) 
    Maximum amount of data in this buffer. If -1 or not set, the buffer will grow undefinitely. Can be smaller than the current buffer size ( which will not shrink ). When the limit is reached, the buffer will be flushed ( if out is set ) or throw exception.
 public  void setOffset(int off) 
    Returns the start offset of the bytes.
 public  void setOptimizedWrite(boolean optimizedWrite) 
 public boolean startsWith(String s) 
    Returns true if the message bytes starts with the specified string.
 public boolean startsWithIgnoreCase(String s,
    int pos) 
    Returns true if the message bytes starts with the specified string.
 public CharSequence subSequence(int start,
    int end) 
 public int substract() throws IOException 
 public int substract(CharChunk src) throws IOException 
 public int substract(char[] src,
    int off,
    int len) throws IOException 
 public String toString() 
 public String toStringInternal()