Examples of PrintStream


Examples of com.zaranux.client.java.io.PrintStream

      in = fdIn; //new BufferedInputStream(fdIn);
       
      FileOutputStream fdOut = new FileOutputStream(FileDescriptor.out);
      fdOut.setOutputBuffer(outBuffer);
      //out = new PrintStream(new BufferedOutputStream(fdOut, 128), true);
      out = new PrintStream(fdOut, true);
     



       
      FileOutputStream fdErr = new FileOutputStream(FileDescriptor.err);
         fdErr.setErrorBuffer(errBuffer);
      err = new PrintStream(new BufferedOutputStream(fdErr, 128), true);
     
    }
View Full Code Here

Examples of java.io.PrintStream

    }

   
    @Test public void larq_example_1() throws Exception
    {
        PrintStream pOut = System.out ;
        PrintStream pNull = new PrintStream(new ByteArrayOutputStream()) ;
        System.setOut(pNull) ;
        try {
            ExLucene1.main(null) ;
        } finally { System.setOut(pOut) ; }
    }
View Full Code Here

Examples of java.io.PrintStream

        } finally { System.setOut(pOut) ; }
    }

    @Test public void larq_example_2() throws Exception
    {
        PrintStream pOut = System.out ;
        PrintStream pNull = new PrintStream(new ByteArrayOutputStream()) ;
        System.setOut(pNull) ;
        try {
            ExLucene2.main(null) ;
        } finally { System.setOut(pOut) ; }
    }
View Full Code Here

Examples of java.io.PrintStream

        } finally { System.setOut(pOut) ; }
    }

    @Test public void larq_example_3() throws Exception
    {
        PrintStream pOut = System.out ;
        PrintStream pNull = new PrintStream(new ByteArrayOutputStream()) ;
        System.setOut(pNull) ;
        try {
            ExLucene3.main(null) ;
        } finally { System.setOut(pOut) ; }
    }
View Full Code Here

Examples of java.io.PrintStream

        } finally { System.setOut(pOut) ; }
    }

    @Test public void larq_example_4() throws Exception
    {
        PrintStream pOut = System.out ;
        PrintStream pNull = new PrintStream(new ByteArrayOutputStream()) ;
        System.setOut(pNull) ;
        try {
            ExLucene4.main(null) ;
        } finally { System.setOut(pOut) ; }
    }
View Full Code Here

Examples of java.io.PrintStream

            ExLucene4.main(null) ;
        } finally { System.setOut(pOut) ; }
    }
    @Test public void larq_example_5() throws Exception
    {
        PrintStream pOut = System.out ;
        PrintStream pNull = new PrintStream(new ByteArrayOutputStream()) ;
        System.setOut(pNull) ;
        try {
            ExLucene5.main(null) ;
        } finally { System.setOut(pOut) ; }
    }
View Full Code Here

Examples of java.io.PrintStream

    }

    private void testTraceDebug() {
        TraceSystem ts = new TraceSystem(null);
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ts.setSysOut(new PrintStream(out));
        ts.setLevelSystemOut(TraceSystem.DEBUG);
        ts.getTrace("test").debug(new Exception("error"), "test");
        ts.close();
        String outString = new String(out.toByteArray());
        assertContains(outString, "error");
View Full Code Here

Examples of java.io.PrintStream

  public String exception(Throwable t) throws IOException{
    if(t == null)
      return null;
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    try{
      t.printStackTrace(new PrintStream(baos));
    }finally{
      baos.close();
    }
    return baos.toString();
  }
View Full Code Here

Examples of java.io.PrintStream

     * Results are sorted by property name.
     */   
    public static void print( String fileName, Properties props ) throws IOException {

        FileOutputStream stream = null;
        PrintStream writer = null;

        try {

        stream = new FileOutputStream(fileName);
          writer = new PrintStream(stream);
   
            List names = new ArrayList();
            Enumeration enumeration = props.propertyNames();
            while ( enumeration.hasMoreElements() ) {
                String name = (String) enumeration.nextElement();
                names.add(name);
            }
            Collections.sort(names);
   
            StringBuffer sb;
   
            for (Iterator nIt=names.iterator(); nIt.hasNext(); ) {
              String name = (String) nIt.next();
   
              String value = props.getProperty(name);
   
              sb = new StringBuffer();
   
              sb.append(name);
              sb.append("="); //$NON-NLS-1$
              sb.append(value);
   
              writer.println(sb.toString());
            }
            writer.flush();
        } finally {
            try {
                if (writer != null) {
                    writer.close();
                }
            } catch (Exception e){
                               
            }
            try {
View Full Code Here

Examples of java.io.PrintStream

        deleteDb("script");
        String outFile = "test.out.txt";
        String inFile = fileName;
        conn = getConnection("script");
        stat = conn.createStatement();
        out = new PrintStream(new FileOutputStream(outFile));
        errors = new StringBuilder();
        testFile(inFile);
        conn.close();
        out.close();
        if (errors.length() > 0) {
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.