private void setLumpChars(XMLLump lump, char[] chars, int start, int length) { lump.start = buffer.size; lump.length = length; if (length > 0) { buffer.append(chars, start, length); } }
public void unread(char c) { if (c != EOF) { pushback.append(c); } }
public void write(char[] storage, int offset, int size) { incompleteline.append(storage, offset, size); } }
private void setLumpString(XMLLump lump, String string) { lump.start = buffer.size; lump.length = string.length(); buffer.append(string); }
/** * @param i * Appends the specified integer rendered as a string onto this * CharWrap. * @return A reference to this CharWrap */ public CharWrap append(int i) { append(Integer.toString(i)); return this; }
/** * Constructs a CharWrap with the specified initial contents, in an array * allowing for expansion of factor 2. * * @param initialcontents * The initial contents of the CharWrap */ public CharWrap(String initialcontents) { this(initialcontents.length() * 2); append(initialcontents); }
/** Appends the "toString" value of the supplied Object to this CharWrap. * The value will not be checked for <code>null</code>. * @param o appends o.toString * @return CharWrap */ public CharWrap append(Object o) { return append(o.toString()); }
public String render(Object torendero) { String[] torender = (String[]) torendero; CharWrap togo = new CharWrap(); togo.append(torender.length).append(':'); for (int i = 0; i < torender.length; ++ i) { String string = torender[i]; togo.append(string.length()).append(':').append(string); } return togo.toString(); }
public static String renderStyle(Map torender) { CharWrap togo = new CharWrap(); for (Iterator sit = torender.keySet().iterator(); sit.hasNext();) { String key = (String) sit.next(); String value = (String) torender.get(key); if (togo.size != 0) { togo.append(' '); } togo.append(key).append(": ").append(value).append(';'); } return togo.toString(); }
/** Converts this CharWrapVector to a String for debugging purposes. Word boundaries * are represented with the character |. * @return The data in this CharWrapVector as a String for debugging purposes. */ public String toDebugString() { CharWrap togo = new CharWrap(); for (int i = 0; i < filled; ++ i) { togo.append('|').append(storage[i]).append('|'); } return togo.toString(); } }
public String getStackHead() { CharWrap togo = new CharWrap(); if (targetexception != null) { togo.append("Target exception of " + targetexception.getClass()); } else if (category != null) { togo.append("Exception category " + category); } togo.append("\nSuccessive lines until stack trace show causes progressing to exception site:\n").append(getMessage()); return togo.toString(); }
/** Convert a pathinfo array into an array of segments * * @param paths paths to convert * @return array of segments */ public static String toPathInfo(String[] paths) { CharWrap togo = new CharWrap(); for (int i = 0; i < paths.length; ++ i) { togo.append('/').append(URLEncoder.encode(paths[i])); } return togo.toString(); }
public static String makeURLAttributes(ParameterList params) { CharWrap togo = new CharWrap(); for (int i = 0; i < params.size(); ++i) { UIParameter param = params.parameterAt(i); togo.append("&").append(URLEncoder.encode(param.name)).append("=") .append(URLEncoder.encode(param.value)); } return togo.toString(); }
public static String readString(PushbackRIS pbr, String delimiters) { CharWrap togo = new CharWrap(); while (!pbr.EOF()) { char c = pbr.get(); if (delimiters.indexOf(c) != -1) { pbr.unread(c); break; } togo.append(c); } return togo.toString(); }
public void println(String toprint) { if (incompleteline.size() > 0) { incompleteline.append(toprint); stringlist.add(incompleteline.toString()); incompleteline.clear(); } else { stringlist.add(toprint); } }
public static String getPending(ReadInputStream ris) { CharWrap unexpected = new CharWrap(); // TODO: this is rubbish! We cannot expect EOF until we actually read the // char. while (!ris.EOF()) { char c = ris.get(); if (unexpected.size() < 32) { unexpected.append(c); } } return unexpected.toString(); }