Package java.io

Examples of java.io.PrintWriter.checkError()


    Socket sock = new Socket(InetAddress.getLocalHost(), PORT);
    OutputStream out = sock.getOutputStream();
    PrintWriter writer = new PrintWriter(new OutputStreamWriter(out));

    writer.print("HELO foo\r\n");
    assert(!writer.checkError());

    Thread.sleep(2000);

    writer.print("HELO bar\r\n");
    assert(writer.checkError());
View Full Code Here


    assert(!writer.checkError());

    Thread.sleep(2000);

    writer.print("HELO bar\r\n");
    assert(writer.checkError());

    wiser.stop();
  }

  /** */
 
View Full Code Here

            // Print the file epilog
            writer.println("</tomcat-users>");

            // Check for errors that occurred while printing
            if (writer.checkError()) {
                writer.close();
                fileNew.delete();
                throw new IOException
                    (sm.getString("memoryUserDatabase.writeException",
                                  fileNew.getAbsolutePath()));
View Full Code Here

                }

                @Override
                public boolean checkError() {
                    this.checkClosed();
                    return delegatee.checkError();
                }

                @Override
                public void close() {
                    this.checkClosed();
View Full Code Here

        assert name != null;
        assert script != null;
        PrintWriter output = open(name);
        try {
            DmdlEmitter.emit(script, output);
            if (output.checkError()) {
                throw new IOException(MessageFormat.format(
                        "Cannot output DMDL {0}",
                        name));
            }
        } finally {
View Full Code Here

            // Print the file epilog
            writer.println("</tomcat-users>");

            // Check for errors that occurred while printing
            if (writer.checkError()) {
                writer.close();
                fileNew.delete();
                throw new IOException
                    (sm.getString("memoryUserDatabase.writeException",
                                  fileNew.getAbsolutePath()));
View Full Code Here

            // Print the file epilog
            writer.println("</database>");

            // Check for errors that occurred while printing
            if (writer.checkError()) {
                writer.close();
                fileNew.delete();
                throw new IOException
                    ("Saving database to '" + pathname + "'");
            }
View Full Code Here

      } catch (IOException e) {
        throw new TermException(new JavaObjectTerm(e));
      }
    } else if (stream instanceof PrintWriter) {
      PrintWriter out = (PrintWriter) stream;
      if (out.checkError()) {
        if (!forceFlag) {
          throw new SystemException("output stream error");
        }
      }
      out.flush();
View Full Code Here

            // Print the file epilog
            writer.println("</tomcat-users>");

            // Check for errors that occurred while printing
            if (writer.checkError()) {
                writer.close();
                fileNew.delete();
                throw new IOException
                    (sm.getString("memoryUserDatabase.writeException",
                                  fileNew.getAbsolutePath()));
View Full Code Here

    {
      writer.flush();
      writer.close();

      // Check for errors
      if (writer.checkError())
      {
        if (file.exists())
          file.delete();

        _error(_XML_ENCODING_ERROR + path);
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.