/** * Same as {@link #getReader()}, but doesn't encapsulate the result in a {@link BufferedReader}; * * @return An unbuffered reader. * @throws IOException */ protected Reader getUnbufferedReader() throws IOException { if (body != null) return new CharSequenceReader(new String(body, UTF8)); return new InputStreamReader(getInputStream(), req.getCharacterEncoding()); }
/** * Same as {@link #getReader()}, but doesn't encapsulate the result in a {@link BufferedReader}; * * @return An unbuffered reader. * @throws IOException */ protected Reader getUnbufferedReader() throws IOException { if (body != null) return new CharSequenceReader(new String(body, UTF8)); return new InputStreamReader(getInputStream(), req.getCharacterEncoding()); }
/** * Same as {@link #getReader()}, but doesn't encapsulate the result in a {@link BufferedReader}; * * @return An unbuffered reader. * @throws IOException */ protected Reader getUnbufferedReader() throws IOException { if (body != null) return new CharSequenceReader(new String(body, UTF8)); return new InputStreamReader(getInputStream(), req.getCharacterEncoding()); }
/** * Same as {@link #getReader()}, but doesn't encapsulate the result in a {@link BufferedReader}; * * @return An unbuffered reader. * @throws IOException */ protected Reader getUnbufferedReader() throws IOException { if (body != null) return new CharSequenceReader(body); return new InputStreamReader(getInputStream(), getCharacterEncoding()); }
/** * Constructor. * * @param pipe The parser input. * @throws IOException */ public ParserReader(ParserPipe pipe) throws IOException { this.unbuffered = pipe.unbuffered; if (pipe.isString()) { String in = pipe.getInputAsString(); this.r = new CharSequenceReader(in); this.buff = new char[in.length() < 1024 ? in.length() : 1024]; } else { Reader _r = pipe.getReader(); if (_r instanceof ParserReader) this.r = ((ParserReader)_r).r; else this.r = _r; this.buff = new char[1024]; } pipe.setPositionable(this); }
/** * Constructor. * * @param pipe The parser input. * @throws IOException */ public ParserReader(ParserPipe pipe) throws IOException { this.unbuffered = pipe.unbuffered; if (pipe.isString()) { String in = pipe.getInputAsString(); this.r = new CharSequenceReader(in); this.buff = new char[in.length() < 1024 ? in.length() : 1024]; } else { Reader _r = pipe.getReader(); if (_r instanceof ParserReader) this.r = ((ParserReader)_r).r; else this.r = _r; this.buff = new char[1024]; } pipe.setPositionable(this); }
/** * Constructor. * * @param pipe The parser input. * @throws IOException */ public ParserReader(ParserPipe pipe) throws IOException { this.unbuffered = pipe.unbuffered; if (pipe.isString()) { String in = pipe.getInputAsString(); this.r = new CharSequenceReader(in); this.buff = new char[in.length() < 1024 ? in.length() : 1024]; } else { Reader _r = pipe.getReader(); if (_r instanceof ParserReader) this.r = ((ParserReader)_r).r; else this.r = _r; this.buff = new char[1024]; } pipe.setPositionable(this); }