@Override public final Appendable append(char c) throws IOException { write(c); return this; } }
@Override public Appendable append(CharSequence csq, int start, int end) throws IOException { write(csq.subSequence(start, end).toString()); return null; }
private int readExpDigits(CharArr arr, int lim) throws IOException { while (--lim>=0) { int ch = getChar(); if (ch>='0' && ch<='9') { arr.write(ch); } else { if (ch!=-1) start--; // back up return NUMBER; } } return BIGNUMBER; }
protected void getNewlineComment() throws IOException { // read a # or a //, so go until newline for (;;) { int ch = getChar(); if (ch != -1) outWS.write(ch); // don't worry about DOS /r/n... we'll stop on the \r and let the rest of the whitespace // eater consume the \n if (ch == '\n' || ch == '\r' || ch == -1) { return; } } }
public static void writeStringPart(char[] val, int start, int end, CharArr out) { for (int i=start; i<end; i++) { char ch = val[i]; // When ch>=1f, (ch*146087937)&0xd6a01f80) is 0 only for characters that need escaping: " \\ u2028 u2029 // and has 7 false positives: 204a 4051 802f c022 c044 e04a e04b if (ch > 0x1f && ((ch * 146087937) & 0xd6a01f80) != 0) { out.write(ch); } else { writeChar(ch, out); } } }
public static void writeStringPart(CharSequence chars, int start, int end, CharArr out) { for (int i=start; i<end; i++) { char ch = chars.charAt(i); // When ch>=1f, (ch*146087937)&0xd6a01f80) is 0 only for characters that need escaping: " \\ u2028 u2029 // and has 7 false positives: 204a 4051 802f c022 c044 e04a e04b if ( ch>0x1f && ((ch*146087937)&0xd6a01f80)!=0 ) { out.write(ch); } else { writeChar(ch, out); } } }
public static void writeStringPart(CharSequence chars, int start, int end, CharArr out) { for (int i=start; i<end; i++) { char ch = chars.charAt(i); // When ch>=1f, (ch*146087937)&0xd6a01f80) is 0 only for characters that need escaping: " \\ u2028 u2029 // and has 7 false positives: 204a 4051 802f c022 c044 e04a e04b if ( ch>0x1f && ((ch*146087937)&0xd6a01f80)!=0 ) { out.write(ch); } else { writeChar(ch, out); } } }
protected void getNewlineComment() throws IOException { // read a # or a //, so go until newline for (;;) { int ch = getChar(); if (ch != -1) outWS.write(ch); // don't worry about DOS /r/n... we'll stop on the \r and let the rest of the whitespace // eater consume the \n if (ch == '\n' || ch == '\r' || ch == -1) { return; } } }
private int readExpDigits(CharArr arr, int lim) throws IOException { while (--lim>=0) { int ch = getChar(); if (ch>='0' && ch<='9') { arr.write(ch); } else { if (ch!=-1) start--; // back up return NUMBER; } } return BIGNUMBER; }
public static void writeStringPart(char[] val, int start, int end, CharArr out) { for (int i=start; i<end; i++) { char ch = val[i]; // When ch>=1f, (ch*146087937)&0xd6a01f80) is 0 only for characters that need escaping: " \\ u2028 u2029 // and has 7 false positives: 204a 4051 802f c022 c044 e04a e04b if (ch > 0x1f && ((ch * 146087937) & 0xd6a01f80) != 0) { out.write(ch); } else { writeChar(ch, out); } } }
public void indent() { if (indent >= 0) { out.write('\n'); if (indent > 0) { int spaces = level*indent; out.reserve(spaces); for (int i=0; i<spaces; i++) { out.unsafeWrite(' '); } } } }
public void indent() { if (indent >= 0) { out.write('\n'); if (indent > 0) { int spaces = level*indent; out.reserve(spaces); for (int i=0; i<spaces; i++) { out.unsafeWrite(' '); } } } }
/** Reads a JSON numeric value into the output. */ public void getNumberChars(CharArr output) throws IOException { int ev=0; if (valstate==0) ev=nextEvent(); if (valstate == LONG || valstate == NUMBER) output.write(this.out); else if (valstate==BIGNUMBER) { continueNumber(output); } else { throw err("Unexpected " + ev); } valstate=0; }
/** Reads a JSON numeric value into the output. */ public void getNumberChars(CharArr output) throws IOException { int ev=0; if (valstate==0) ev=nextEvent(); if (valstate == LONG || valstate == NUMBER) output.write(this.out); else if (valstate==BIGNUMBER) { continueNumber(output); } else { throw err("Unexpected " + ev); } valstate=0; }