@Override public void writeNull(String name) throws IOException { writer.write("N;"); }
public static FastWriter wrap(Writer sink) { return (sink instanceof FastWriter) ? (FastWriter)sink : new FastWriter(sink); }
public void flushBuffer() throws IOException { flush(buf, 0, pos); pos=0; } }
public SolrJSONWriter(Writer writer, String namedListStyle) { this.writer = writer == null ? null : FastWriter.wrap(writer); this.namedListStyle = namedListStyle; }
/** * done with all writing */ public void close() throws IOException { if (writer != null) writer.flushBuffer(); }
public TextResponseWriter(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) { this.writer = FastWriter.wrap(writer); this.schema = req.getSchema(); this.req = req; this.rsp = rsp; String indent = req.getParams().get("indent"); if (indent != null && !"".equals(indent) && !"off".equals(indent)) { doIndent=true; } returnFields = rsp.getReturnFields(); }
/** done with this ResponseWriter... make sure any buffers are flushed to writer */ public void close() throws IOException { writer.flushBuffer(); }
@Override public void _writeChar(char c) throws IOException { writer.write(c); }
@Override public FastWriter append(char c) throws IOException { if (pos >= buf.length) { flush(buf,0,pos); pos=0; } buf[pos++] = c; return this; }
public static FastWriter wrap(Writer sink) { return (sink instanceof FastWriter) ? (FastWriter)sink : new FastWriter(sink); }
@Override public void write(int c) throws IOException { write((char)c); }
public void write(char c) throws IOException { if (pos >= buf.length) { flush(buf,0,pos); pos=0; } buf[pos++] = c; }
@Override public void writeNull(String name) throws IOException { writer.write("null"); }
@Override public void close() throws IOException { flush(); if (sink != null) sink.close(); }
@Override public void writeNull(String name) throws IOException { writer.write("nil"); }
@Override public void close() throws IOException { flush(); sink.close(); }
@Override public void writeBool(String name, boolean val) throws IOException { writer.write(val ? "b:1;" : "b:0;"); }
@Override public void flush() throws IOException { flush(buf, 0, pos); pos=0; if (sink != null) sink.flush(); }
@Override public void writeMapOpener(int size) throws IOException { writer.write("array("); }