private String _peekLine (final NonBlockingBufferedReader in) throws IOException { if (m_currentLine == null) m_currentLine = in.readLine (); return m_currentLine; }
final NonBlockingBufferedReader rdr = new NonBlockingBufferedReader (new InputStreamReader (System.in, StandardCharsets.ISO_8859_1)); while (true) if ("exit".equals (rdr.readLine ()))
void setInput (final String fn) throws IOException { try { final File fp = new File (fn); if (!fp.exists ()) throw new IOException ("File " + fn + " not found."); if (fp.isDirectory ()) throw new IOException (fn + " is a directory. Please use a valid file name."); if (JavaCCGlobals.isGeneratedBy ("JJTree", fn)) throw new IOException (fn + " was generated by jjtree. Cannot run jjtree again."); m_sInputFilename = fp.getPath (); m_in = new NonBlockingBufferedReader (new InputStreamReader (new FileInputStream (m_sInputFilename), Options.getGrammarEncoding ())); } catch (final SecurityException se) { throw new IOException ("Security violation while trying to open " + fn, se); } }
try (final NonBlockingBufferedReader aBR = new NonBlockingBufferedReader (aReader)) while ((sLine = aBR.readLine ()) != null)
/** * Generate the output file. * * @param out * @throws IOException */ public void generate (@WillNotClose final Writer out) throws IOException { final InputStream is = ClassPathResource.getInputStream (m_templateName); if (is == null) throw new IOException ("Invalid template name: " + m_templateName); try (final NonBlockingBufferedReader in = new NonBlockingBufferedReader (new InputStreamReader (is, StandardCharsets.UTF_8))) { _process (in, out, false); } }
File aPendingFile; try ( final NonBlockingBufferedReader aPendingInfoReader = new NonBlockingBufferedReader (new FileReader (sPendingInfoFile))) sOriginalMIC = aPendingInfoReader.readLine (); aPendingFile = new File (aPendingInfoReader.readLine ());
private String _getLine (final NonBlockingBufferedReader in) throws IOException { final String line = m_currentLine; m_currentLine = null; if (line == null) in.readLine (); return line; }
while ((line = reader.readLine ()) != null)
while ((line = reader.readLine ()) != null)
while ((str = reader.readLine ()) != null)
while ((line = br.readLine ()) != null)