public Message[] parse(Reader reader) throws IOException { JSON.ReaderSource source=_readerPool.poll(); if (source == null) source=new JSON.ReaderSource(reader); else source.setReader(reader); Object batch=_batchJSON.parse(source); _readerPool.offer(source); if (batch == null) return new Message[0]; if (batch.getClass().isArray()) return (Message[])batch; return new Message[] {(Message)batch}; }
public Message[] parse(Reader reader) throws IOException { JSON.ReaderSource source =_readerPool.poll(); if (source==null) source=new JSON.ReaderSource(reader); else source.setReader(reader); Object batch=_batchJSON.parse(source); _readerPool.offer(source); if (batch==null) return new Message[0]; if (batch.getClass().isArray()) return (Message[])batch; return new Message[]{(Message)batch}; }
public char peek() { getNext(); return (char)_next; }
public char next() { getNext(); char c=(char)_next; _next=-1; return c; }
public boolean hasNext() { getNext(); if (_next<0) { scratch=null; return false; } return true; }
/** * @param s Stream containing JSON object or array. * @param stripOuterComment If true, an outer comment around the JSON is ignored. * @return A Map, Object array or primitive array parsed from the JSON. */ public static Object parse(Reader in, boolean stripOuterComment) throws IOException { return __default.parse(new ReaderSource(in),stripOuterComment); }
/** * @param in Reader containing JSON object or array. * @return A Map, Object array or primitive array parsed from the JSON. */ public static Object parse(Reader in) throws IOException { return __default.parse(new ReaderSource(in),false); }