Package java.io

Examples of java.io.PrintStream.checkError()


                for (String r : res) {
                  out.println(r);
                }
                counter += res.size();
                res.clear();
                if (out.checkError()) {
                  break;
                }
              }
            } catch (IOException e) {
              console.printError("Failed with exception " + e.getClass().getName() + ":"
View Full Code Here


                throw new IOException();
            }
        });
        os.print(fileString.substring(0, 501));

        assertTrue("Checkerror should return true", os.checkError());
    }

    /**
     * @tests java.io.PrintStream#close()
     */
 
View Full Code Here

                throw new IOException();
            }
        });
        os.print(fileString.substring(0, 501));

        assertTrue("Checkerror should return true", os.checkError());
    }

    /**
     * @tests {@link java.io.PrintStream#clearError()}
     */
 
View Full Code Here

                for (String r : res) {
                  out.println(r);
                }
                counter += res.size();
                res.clear();
                if (out.checkError()) {
                  break;
                }
              }
            } catch (IOException e) {
              console.printError("Failed with exception " + e.getClass().getName() + ":"
View Full Code Here

      w.println(roundCount);
      w.println(battleCount);

      // PrintStreams don't throw IOExceptions during prints, they simply set a flag.... so check it here.
      if (w.checkError()) {
        out.println("I could not write the count!");
      }
    } catch (IOException e) {
      out.println("IOException trying to write: ");
      e.printStackTrace(out);
View Full Code Here

        PrintStream ps = out instanceof PrintStream ? (PrintStream) out : null;
        byte buf[] = new byte[buffSize];
        int bytesRead = in.read(buf);
        while (bytesRead >= 0) {
            out.write(buf, 0, bytesRead);
            if ((ps != null) && ps.checkError()) {
                throw new IOException("Unable to write to output stream.");
            }
            bytesRead = in.read(buf);
        }
    }
View Full Code Here

    final byte[] buf = new byte[buffSize];
    try {
      int bytesRead = in.read(buf);
      while (bytesRead >= 0) {
        out.write(buf, 0, bytesRead);
        if ((ps != null) && ps.checkError()) {
          throw new IOException("Unable to write to output stream.");
        }
        bytesRead = in.read(buf);
      }
    } finally {
View Full Code Here

                    ps.format("%12s", allResults.get(j).get(variables));
                }
                ps.println();
            }
            ps.close();
            if (ps.checkError()) {
                throw new IOException();
            }
            reader.close();
        } catch (ExpressionException e) {
            System.out.println(
View Full Code Here

                for (String r : res) {
                  out.println(r);
                }
                counter += res.size();
                res.clear();
                if (out.checkError()) {
                  break;
                }
              }
            } catch (IOException e) {
              console.printError("Failed with exception " + e.getClass().getName() + ":"
View Full Code Here

    final byte[] buf = new byte[buffSize];
    try {
      int bytesRead = in.read(buf);
      while (bytesRead >= 0) {
        out.write(buf, 0, bytesRead);
        if ((ps != null) && ps.checkError()) {
          throw new IOException("Unable to write to output stream.");
        }
        bytesRead = in.read(buf);
      }
    } finally {
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.