((StringBuffer) appendable).appendCodePoint(codePoint);
b1 = buffer[i++]; c = ((b0 & 3) << 4) | ((b1 & 0xf0) >>> 4); sb.appendCodePoint(PICKETBOX_COMPATIBILITY.encode(c)); case 1: b2 = buffer[i++]; c = ((b1 & 0xf) << 2) | ((b2 & 0xc0) >>> 6); sb.appendCodePoint(PICKETBOX_COMPATIBILITY.encode(c)); c = b2 & 0x3f; sb.appendCodePoint(PICKETBOX_COMPATIBILITY.encode(c)); break; b2 = buffer[pos++]; c = (b0 & 0xfc) >>> 2; sb.appendCodePoint(PICKETBOX_COMPATIBILITY.encode(c)); c = ((b0 & 3) << 4) | ((b1 & 0xf0) >>> 4); sb.appendCodePoint(PICKETBOX_COMPATIBILITY.encode(c)); c = ((b1 & 0xf) << 2) | ((b2 & 0xc0) >>> 6); sb.appendCodePoint(PICKETBOX_COMPATIBILITY.encode(c)); c = b2 & 0x3f; sb.appendCodePoint(PICKETBOX_COMPATIBILITY.encode(c));
((StringBuffer) appendable).appendCodePoint(codePoint);
((StringBuffer) appendable).appendCodePoint(codePoint);
((StringBuffer) appendable).appendCodePoint(codePoint);
((StringBuffer) appendable).appendCodePoint(codePoint);
((StringBuffer) appendable).appendCodePoint(codePoint);
/** * Possible states in which the current readline operation may be in. */ private static enum State { /** * The user is just typing away */ NORMAL, /** * In the middle of a emacs seach */ SEARCH, FORWARD_SEARCH, /** * VI "yank-to" operation ("y" during move mode) */ VI_YANK_TO, /** * VI "delete-to" operation ("d" during move mode) */ VI_DELETE_TO, /** * VI "change-to" operation ("c" during move mode) */ VI_CHANGE_TO }
@Override public Output appendCodePoint( int codePoint ) { output.appendCodePoint( codePoint ); return this; } }
public static String newInstance_(Object receiver, int size) { final StringBuffer stringBuffer = new StringBuffer(size); for (int i = 0; i < size; i++) { stringBuffer.appendCodePoint(0); } return stringBuffer.toString(); }
public static void main(String[] args) throws FileNotFoundException { StringBuffer buf = new StringBuffer(); buf.appendCodePoint(0x1D11E); buf.appendCodePoint(0x1D160); buf.appendCodePoint(0x1D160); buf.appendCodePoint(0x1D160); PrintWriter out = new PrintWriter(new OutputStreamWriter(new FileOutputStream("music.html"), Charset.forName("UTF_32BE"))); out.println(buf); out.close(); } }
@SuppressWarnings("synthetic-access") @Override public synchronized void write(final int data) throws IOException { // NOPMD (method level synchronization) this.stringBuffer.appendCodePoint(data); if (this.stringBuffer.lastIndexOf(this.lineSeperator) != -1) { FinalStep.this.logArea.append(this.stringBuffer.toString()); this.stringBuffer.setLength(0); } }
@SuppressWarnings("synthetic-access") @Override public synchronized void write(final int data) throws IOException { // NOPMD (method level synchronization) this.stringBuffer.appendCodePoint(data); if (this.stringBuffer.lastIndexOf(this.lineSeperator) != -1) { FinalStep.this.logArea.append(this.stringBuffer.toString()); this.stringBuffer.setLength(0); } }
public static String emojiCode(String text) { StringBuffer sb = new StringBuffer(); for (int i = 0; i < text.length(); i++) { int ch = text.codePointAt(i); if (ch <= 128) { sb.appendCodePoint(ch); } else if (ch > 128 && (ch < 159 || (ch >= 55296 && ch <= 57343))) { continue; } else { sb.append("0x" + Integer.toHexString(ch) + ""); } } return sb.toString(); }
String s = "aaa\\u2022bbb\\u2014ccc"; StringBuffer buf = new StringBuffer(); Matcher m = Pattern.compile("\\\\u([0-9A-Fa-f]{4})").matcher(s); while (m.find()) { try { int cp = Integer.parseInt(m.group(1), 16); m.appendReplacement(buf, ""); buf.appendCodePoint(cp); } catch (NumberFormatException e) { } } m.appendTail(buf); s = buf.toString();
private static String undoMqlKeyEscape(String s) { String[] part = s.split("\\$"); StringBuffer sb = new StringBuffer(part[0]); for (int i = 1; i<part.length; i++) { try { int code = Integer.parseInt(part[i].substring(0, 4), 16); sb.appendCodePoint(code).append(part[i].substring(4)); } catch (IndexOutOfBoundsException e) { sb.append(part[i]); } catch (NumberFormatException e) { sb.append(part[i]); } } return sb.toString(); }
/** * Closes the element opened by {@link #openElement(boolean, String)}. * * @param newLine {@code true} for invoking {@link #newLine()} last. */ private void closeElement(final boolean newLine) { buffer.appendCodePoint(symbols.getClosingBracket(0)); if (newLine) { newLine(); } }
/** * Closes the element opened by {@link #openElement(boolean, String)}. * * @param newLine {@code true} for invoking {@link #newLine()} last. */ private void closeElement(final boolean newLine) { buffer.appendCodePoint(symbols.getClosingBracket(0)); if (newLine) { newLine(); } }
/** * Appends a separator if needed, then opens a new element. * * @param newLine {@code true} for invoking {@link #newLine()} first. * @param keyword the element keyword (e.g. {@code "DATUM"}, {@code "AXIS"}, <i>etc</i>). */ private void openElement(final boolean newLine, String keyword) { if (newLine && buffer.length() != elementStart) { newLine(); } appendSeparator(); if (toUpperCase != 0) { final Locale locale = symbols.getLocale(); keyword = (toUpperCase >= 0) ? keyword.toUpperCase(locale) : keyword.toLowerCase(locale); } elementStart = buffer.append(keyword).appendCodePoint(symbols.getOpeningBracket(0)).length(); }
/** * Appends a separator if needed, then opens a new element. * * @param newLine {@code true} for invoking {@link #newLine()} first. * @param keyword the element keyword (e.g. {@code "DATUM"}, {@code "AXIS"}, <i>etc</i>). */ private void openElement(final boolean newLine, String keyword) { if (newLine && buffer.length() != elementStart) { newLine(); } appendSeparator(); if (toUpperCase != 0) { final Locale locale = symbols.getLocale(); keyword = (toUpperCase >= 0) ? keyword.toUpperCase(locale) : keyword.toLowerCase(locale); } elementStart = buffer.append(keyword).appendCodePoint(symbols.getOpeningBracket(0)).length(); }