FileDocCategorySizeDatePackage
CharCache.javaAPI Docmp4parser 1.0-RC-171868Wed Dec 19 20:10:37 GMT 2012com.googlecode.mp4parser.h264

CharCache

public class CharCache extends Object

Fields Summary
private char[]
cache
private int
pos
Constructors Summary
public CharCache(int capacity)

        cache = new char[capacity];
    
Methods Summary
public voidappend(java.lang.String str)

        char[] chars = str.toCharArray();
        int available = cache.length - pos;
        int toWrite = chars.length < available ? chars.length : available;
        System.arraycopy(chars, 0, cache, pos, toWrite);
        pos += toWrite;
    
public voidappend(char c)

        if (pos < cache.length - 1) {
            cache[pos] = c;
            pos++;
        }
    
public voidclear()

        pos = 0;
    
public intlength()

        return pos;
    
public java.lang.StringtoString()

        return new String(cache, 0, pos);