Package java.io

Examples of java.io.PrintStream.format()


    @Test
    public void testDump() throws Throwable {
        PrintStream printStream = new PrintStream(new ByteArrayOutputStream(), true);
        Object[] objects = new Object[2];
        printStream.format(Locale.FRANCE, "testContextParam2", objects);
        PrintStream p = new PrintStream(printStream, true, "ISO-8859-1");
        Context context = new Context();
        context.dump(p, "testContextIndent");
    }
View Full Code Here


    @Test
    public void testDump() throws Throwable {
        PrintStream p = new PrintStream(new ByteArrayOutputStream(), true, "UTF-8");
        Object[] objects = new Object[1];
        p.format("testKeySerialNumberParam1", objects);
        new KeySerialNumber("testKeySerialNumberBaseKeyID", "testKeySerialNumberDeviceID", "testKeySerialNumberTransactionCounter")
                .dump(p, "testKeySerialNumberIndent");
        assertTrue("Test completed without Exception", true);
    }
View Full Code Here

            while ((expression = reader.readLine()) != null) {
                Function function = new Function(expression);
                allResults.add(function.results());
            }

            ps.format("%3s%3s%3s", "x", "y", "z");
            for (int i = 0; i < allResults.size(); i++) {
                ps.format("%12s", "f" + (i + 1));
            }
            ps.println();
            for (List<Integer> variables : Variables.getTuples()) {
View Full Code Here

                allResults.add(function.results());
            }

            ps.format("%3s%3s%3s", "x", "y", "z");
            for (int i = 0; i < allResults.size(); i++) {
                ps.format("%12s", "f" + (i + 1));
            }
            ps.println();
            for (List<Integer> variables : Variables.getTuples()) {
                for (Integer variable : variables) {
                    ps.format("%3s", variable);
View Full Code Here

                ps.format("%12s", "f" + (i + 1));
            }
            ps.println();
            for (List<Integer> variables : Variables.getTuples()) {
                for (Integer variable : variables) {
                    ps.format("%3s", variable);
                }
                for (int j = 0; j < allResults.size(); j++) {
                    ps.format("%12s", allResults.get(j).get(variables));
                }
                ps.println();
View Full Code Here

            for (List<Integer> variables : Variables.getTuples()) {
                for (Integer variable : variables) {
                    ps.format("%3s", variable);
                }
                for (int j = 0; j < allResults.size(); j++) {
                    ps.format("%12s", allResults.get(j).get(variables));
                }
                ps.println();
            }
            ps.close();
            if (ps.checkError()) {
View Full Code Here

  }

  public static String hex( byte[] data) {
    final ByteArrayOutputStream baos = new ByteArrayOutputStream();
    final PrintStream printer = new PrintStream( baos);
    for ( byte b : data) printer.format( "%02x", b);
    printer.flush();
    return baos.toString();
  }

   /**
 
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.