/** * Sets the reader from which to read and create documents. * Default implementation automatically buffers the Reader if it's not * already buffered. Subclasses that don't want buffering may want to override * this method to simply set the global <tt>in</tt> directly. */ public void setReader(Reader in) { this.in = getBufferedReader(in); }
/** * Returns everything that can be read from the given Reader as a String. * Returns null if the given Reader is null. */ public static String readText(Reader in) throws IOException { // returns null if the reader is null if (in == null) { return (null); } // ensures the reader is buffered BufferedReader br = getBufferedReader(in); // reads all the chars into a buffer StringBuilder sb = new StringBuilder(16000); // make biggish int c; while ((c = br.read()) >= 0) { sb.append((char) c); } return sb.toString(); }
/** * Sets the reader from which to read and create documents. * Default implementation automatically buffers the Reader if it's not * already buffered. Subclasses that don't want buffering may want to override * this method to simply set the global <tt>in</tt> directly. */ public void setReader(Reader in) { this.in = getBufferedReader(in); }
/** * Sets the reader from which to read and create documents. * Default implementation automatically buffers the Reader if it's not * already buffered. Subclasses that don't want buffering may want to override * this method to simply set the global <tt>in</tt> directly. */ public void setReader(Reader in) { this.in = getBufferedReader(in); }
/** * Sets the reader from which to read and create documents. * Default implementation automatically buffers the Reader if it's not * already buffered. Subclasses that don't want buffering may want to override * this method to simply set the global <tt>in</tt> directly. */ public void setReader(Reader in) { this.in = getBufferedReader(in); }
/** * Sets the reader from which to read and create documents. * Default implementation automatically buffers the Reader if it's not * already buffered. Subclasses that don't want buffering may want to override * this method to simply set the global <tt>in</tt> directly. */ public void setReader(Reader in) { this.in = getBufferedReader(in); }
/** * Returns everything that can be read from the given Reader as a String. * Returns null if the given Reader is null. */ public static String readText(Reader in) throws IOException { // returns null if the reader is null if (in == null) { return (null); } // ensures the reader is buffered BufferedReader br = getBufferedReader(in); // reads all the chars into a buffer StringBuilder sb = new StringBuilder(16000); // make biggish int c; while ((c = br.read()) >= 0) { sb.append((char) c); } return sb.toString(); }
/** * Returns everything that can be read from the given Reader as a String. * Returns null if the given Reader is null. */ public static String readText(Reader in) throws IOException { // returns null if the reader is null if (in == null) { return (null); } // ensures the reader is buffered BufferedReader br = getBufferedReader(in); // reads all the chars into a buffer StringBuilder sb = new StringBuilder(16000); // make biggish int c; while ((c = br.read()) >= 0) { sb.append((char) c); } return sb.toString(); }
/** * Returns everything that can be read from the given Reader as a String. * Returns null if the given Reader is null. */ public static String readText(Reader in) throws IOException { // returns null if the reader is null if (in == null) { return (null); } // ensures the reader is buffered BufferedReader br = getBufferedReader(in); // reads all the chars into a buffer StringBuilder sb = new StringBuilder(16000); // make biggish int c; while ((c = br.read()) >= 0) { sb.append((char) c); } return sb.toString(); }
/** * Returns everything that can be read from the given Reader as a String. * Returns null if the given Reader is null. */ public static String readText(Reader in) throws IOException { // returns null if the reader is null if (in == null) { return (null); } // ensures the reader is buffered BufferedReader br = getBufferedReader(in); // reads all the chars into a buffer StringBuilder sb = new StringBuilder(16000); // make biggish int c; while ((c = br.read()) >= 0) { sb.append((char) c); } return sb.toString(); }