FileDocCategorySizeDatePackage
TemporaryBuffer.javaAPI DocAndroid 5.1 API1275Thu Mar 12 22:22:30 GMT 2015android.graphics

TemporaryBuffer

public class TemporaryBuffer extends Object
hide

Fields Summary
private static char[]
sTemp
Constructors Summary
Methods Summary
public static char[]obtain(int len)

        char[] buf;

        synchronized (TemporaryBuffer.class) {
            buf = sTemp;
            sTemp = null;
        }

        if (buf == null || buf.length < len) {
            buf = ArrayUtils.newUnpaddedCharArray(len);
        }

        return buf;
    
public static voidrecycle(char[] temp)

        if (temp.length > 1000) return;

        synchronized (TemporaryBuffer.class) {
            sTemp = temp;
        }