public CharBuf(byte[] bytes) { this.buffer = null; try { String str = new String(bytes, "UTF-8"); __init__(FastStringUtils.toCharArray(str)); } catch (UnsupportedEncodingException e) { Exceptions.handle(e); } }
public final CharBuf addDouble(Double key) { if (dcache == null) { dcache = new SimpleCache<Double, char[]>(20, CacheType.LRU); } char[] chars = dcache.get(key); if (chars == null) { String str = Double.toString(key); chars = FastStringUtils.toCharArray(str); dcache.put(key, chars); } add(chars); return this; }
public final CharBuf addInt(Integer key) { if (icache == null) { icache = new SimpleCache<Integer, char[]>(20, CacheType.LRU); } char[] chars = icache.get(key); if (chars == null) { String str = Integer.toString(key); chars = FastStringUtils.toCharArray(str); icache.put(key, chars); } addChars(chars); return this; }
public final CharBuf addLong(Long key) { if (lcache == null) { lcache = new SimpleCache<Long, char[]>(20, CacheType.LRU); } char[] chars = lcache.get(key); if (chars == null) { String str = Long.toString(key); chars = FastStringUtils.toCharArray(str); lcache.put(key, chars); } add(chars); return this; }
public CharBuf addBigInteger(BigInteger key) { if (bigICache == null) { bigICache = new SimpleCache<BigInteger, char[]>(20, CacheType.LRU); } char[] chars = bigICache.get(key); if (chars == null) { String str = key.toString(); chars = FastStringUtils.toCharArray(str); bigICache.put(key, chars); } add(chars); return this; }
public final CharBuf addFloat(Float key) { if (fcache == null) { fcache = new SimpleCache<Float, char[]>(20, CacheType.LRU); } char[] chars = fcache.get(key); if (chars == null) { String str = Float.toString(key); chars = FastStringUtils.toCharArray(str); fcache.put(key, chars); } add(chars); return this; }
public static Date toDate(Object object) { if (object instanceof Date) { return (Date) object; } else if (object instanceof Value) { return ((Value) object).dateValue(); } else if (object instanceof Calendar) { return ((Calendar) object).getTime(); } else if (object instanceof Long) { return new Date((long) object); } else if (object instanceof String) { String val = (String) object; char[] chars = FastStringUtils.toCharArray(val); if (Dates.isISO8601QuickCheck(chars)) { return Dates.fromISO8601DateLoose(chars); } else { return toDateUS(val); } } return null; }
public final CharBuf add(String str) { add(FastStringUtils.toCharArray(str)); return this; }
public final CharBuf addQuoted(String str) { final char[] chars = FastStringUtils.toCharArray(str); addQuoted(chars); return this; }
public final CharBuf addJsonFieldName(String str) { return addJsonFieldName(FastStringUtils.toCharArray(str)); }
public final CharBuf addJsonEscapedString(String jsonString) { char[] charArray = FastStringUtils.toCharArray(jsonString); return addJsonEscapedString(charArray); }