/** * Read a newline delimited line from the stream, returning the line (without * the newline), or null if EOF reached on an empty line * Warning - strips \n but not \r * Warning - 8KB line length limit as of 0.7.13, @throws IOException if exceeded * Warning - not UTF-8 * * @return null on EOF */ public static String readLine(InputStream in) throws IOException { return readLine(in, (MessageDigest) null); }
/** * Read in a line, placing it into the buffer (excluding the newline). * Warning - strips \n but not \r * Warning - 8KB line length limit as of 0.7.13, @throws IOException if exceeded * Warning - not UTF-8 * * @return true if the line was read, false if eof was reached on an empty line * (returns true for non-empty last line without a newline) */ public static boolean readLine(InputStream in, StringBuilder buf) throws IOException { return readLine(in, buf, (MessageDigest) null); }
String readLine(String method) throws IOException { // Use unbuffered until we can find a BufferedReader that limits line length //if (method == null || "POST".equals(method)) return DataHelper.readLine(_s); //if (_br == null) // _br = new BufferedReader(new InputStreamReader(_s, "ISO-8859-1")); //return _br.readLine(); }
/** * Read the rest of the headers, which keeps firefox * from complaining about connection reset after * an error on the first line. * @since 0.9.14 */ public void drain() { try { String line; do { line = DataHelper.readLine(_s); // \r not stripped so length == 1 is empty } while (line != null && line.length() > 1); } catch (IOException ioe) {} } }
/** * update the hash along the way * Warning - strips \n but not \r * Warning - 8KB line length limit as of 0.7.13, @throws IOException if exceeded * Warning - not UTF-8 * * @param hash null OK * @return null on EOF * @since 0.8.8 */ public static String readLine(InputStream in, MessageDigest hash) throws IOException { StringBuilder buf = new StringBuilder(128); boolean ok = readLine(in, buf, hash); if (ok) return buf.toString(); else return null; }
while (keypw.length() < 6) { System.out.print("Enter password for key \"" + signerName + "\": "); keypw = DataHelper.readLine(System.in); if (keypw == null) { System.out.println("\nEOF reading password");
out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new SecureFileOutputStream(newFile), "UTF-8"))); String s = null; while ((s = DataHelper.readLine(in)) != null) {
String s = null; boolean isDaemon = SystemVersion.isLinuxService(); while ((s = DataHelper.readLine(in)) != null) {
try { String line; while ((line = DataHelper.readLine(in)) != null) { if (line.startsWith("---") && line.contains("BEGIN") && line.contains("PRIVATE")) break; throw new IOException("no private key found"); StringBuilder buf = new StringBuilder(128); while ((line = DataHelper.readLine(in)) != null) { if (line.startsWith("---")) break;
while (alias.length() == 0) { System.out.print("Enter key name (example@mail.i2p): "); alias = DataHelper.readLine(System.in); if (alias == null) { System.out.println("\nEOF reading key name"); keypw = DataHelper.readLine(System.in); if (keypw == null) { System.out.println("\nEOF reading password");
while (keypw.length() < 6) { System.out.print("Enter password for key \"" + signerName + "\": "); keypw = DataHelper.readLine(System.in); if (keypw == null) { System.out.println("\nEOF reading password");
while (keypw.length() < 6) { System.out.print("Enter password for key: "); keypw = DataHelper.readLine(System.in); if (keypw == null) { System.out.println("\nEOF reading password");
boolean ok = DataHelper.readLine(in, command); if (!ok) throw new EOFException("EOF reached before the end of the headers"); readLine(socket, buf, expire - ctx.clock().now()); } else { boolean ok = DataHelper.readLine(in, buf); if (!ok) throw new BadRequestException("EOF reached before the end of the headers");
if (_mode == DG || _mode == RAWHDR) { ByteArrayInputStream bais = new ByteArrayInputStream(data, off, len); String line = DataHelper.readLine(bais); if (line == null) { _log.error("DGRcvr no header line");
StringBuilder buf = new StringBuilder(32); boolean read = DataHelper.readLine(_proxyIn, buf); if (!read) throw new IOException("Unable to read the first line"); _responseCode = handleStatus(buf.toString());
line = DataHelper.readLine(in); if(line == null) { break;