Package java.io

Examples of java.io.LineNumberReader.readLine()


                        new LineNumberReader(new InputStreamReader(socket.getInputStream()));
                String key = lin.readLine();
                if(!_key.equals(key))
                    continue;

                String cmd = lin.readLine();
                if(STOP_CMD.equals(cmd)){
        AlertEngine.getInstance().stop();
        logger.info("Shutting down the server.");

                    try{
View Full Code Here


            }
            if (outLine == null) {
                fail("Output text is shorter than reference text");
            }
            refLine = ref.readLine();
            outLine = out.readLine();
            if (refLine != null && outLine != null & !refLine.equals(outLine)) {
                fail("Difference found on line " + ref.getLineNumber() +
                                            ".\nReference text is: " + refLine +
                                            "\nOutput text is: " + outLine);
            }
View Full Code Here

            LineNumberReader sourceFileReader = new LineNumberReader(new StringReader(sourceCode));
            StringBuffer sourceCodeBuffer = new StringBuffer();
            log.debug("Line number " + sourceFileReader.getLineNumber());
            String line = null;
            boolean startGeneration = false;
            while ((line = sourceFileReader.readLine()) != null) {
              if (line.contains("@StartGeneration")) {
                sourceCodeBuffer.append(line);
                sourceCodeBuffer.append("\n");
                startGeneration = true;
                containsGenerationTags = true;
View Full Code Here

            boolean containsGenerationTags = false;
            LineNumberReader sourceFileReader = new LineNumberReader(new StringReader(sourceCode));
            StringBuffer sourceCodeBuffer = new StringBuffer();           
            String line = null;
            boolean startGeneration = false;
            while ((line = sourceFileReader.readLine()) != null) {
              if (line.contains("@StartGeneration")) {
                sourceCodeBuffer.append(line);
                sourceCodeBuffer.append("\n");
                startGeneration = true;
                containsGenerationTags = true;
View Full Code Here

  }

  public void stream(Reader reader) throws Exception {
    LineNumberReader lineNumberReader = new LineNumberReader(reader);
    OutputStream out = null;
    for (String line; (line = lineNumberReader.readLine()) != null;) {
      if (line.startsWith("##To:")) {
        if (out != null) {
          out.close();
        }
        out = newOutputStream();
View Full Code Here

                   
                    InputStream is = socket.getInputStream();
                    LineNumberReader lnr = new LineNumberReader(new InputStreamReader(is));
                   
                    // read first line
                    lnr.readLine();
                   
                    OutputStream out = socket.getOutputStream();
                    OutputStreamWriter w = new OutputStreamWriter(out);
                   
                    w.write(strbuf.toString());
View Full Code Here

                   
                    InputStream is = socket.getInputStream();
                    LineNumberReader lnr = new LineNumberReader(new InputStreamReader(is));
                   
                    // read first line
                    lnr.readLine();
                   
                    OutputStream out = socket.getOutputStream();
                    OutputStreamWriter w = new OutputStreamWriter(out);
                   
                    w.write(strbuf.toString());
View Full Code Here

                   
                    InputStream is = socket.getInputStream();
                    LineNumberReader lnr = new LineNumberReader(new InputStreamReader(is));
                   
                    // read first line
                    lnr.readLine();
                   
                    OutputStream out = socket.getOutputStream();
                    OutputStreamWriter w = new OutputStreamWriter(out);
                   
                    w.write(strbuf.toString());
View Full Code Here

                   
                    InputStream is = socket.getInputStream();
                    LineNumberReader lnr = new LineNumberReader(new InputStreamReader(is));
                   
                    // read first line
                    lnr.readLine();
                   
                    OutputStream out = socket.getOutputStream();
                    OutputStreamWriter w = new OutputStreamWriter(out);
                   
                    w.write(strbuf.toString());
View Full Code Here

                new OutputStreamWriter(data.getOutputStream()));

        // write line by line, writing \r\n as required by RFC959 after
        // each line
        String line = null;
        while ((line = in.readLine()) != null) {
            out.write(line, 0, line.length());
            out.write(FTPControlSocket.EOL, 0, FTPControlSocket.EOL.length());
        }
        in.close();
        out.flush();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.