Package org.apache.commons.io.output

Examples of org.apache.commons.io.output.WriterOutputStream


  }

  @Override
    public void writeTo(Writer writer, Syntax syntax) throws IOException,
      ModelRuntimeException, SyntaxNotSupportedException {
    WriterOutputStream stream = new WriterOutputStream(writer, StandardCharsets.UTF_8);
    writeTo(stream, syntax);
  }
View Full Code Here


        row.addContent(123456789);
        row.addContent("A very long text that should be cut");
        row.addContent("A very long text that should not be cut");

        StringWriter writer = new StringWriter();
        PrintStream out = new PrintStream(new WriterOutputStream(writer));
        table.print(out, true);
        out.flush();
        String expected =
                "   id | Name                 |                Centered                \n" +
                "----------------------------------------------------------------------\n" +
View Full Code Here

        table.column(new Col("2"));

        table.addRow().addContent("1", "2");

        StringWriter writer = new StringWriter();
        PrintStream out = new PrintStream(new WriterOutputStream(writer));
        table.print(out, true);
        out.flush();
        String expected =
                "1      | 2\n" +
            "----------\n" +
View Full Code Here

        table.column(new Col("2").alignRight());

        table.addRow().addContent("quite long", "and here an even longer text");

        StringWriter writer = new StringWriter();
        PrintStream out = new PrintStream(new WriterOutputStream(writer));
        table.print(out, true);
        out.flush();
        String expected = //
                  "1     |  2\n" //
                + "----------\n" //
View Full Code Here

        table.column(new Col("2").alignRight());

        table.addRow().addContent("quite long", "and here an even longer text");

        StringWriter writer = new StringWriter();
        PrintStream out = new PrintStream(new WriterOutputStream(writer));
        table.print(out, true);
        out.flush();
        String expected = //
                  "1     | \n" + //
                  "--------\n" + //
View Full Code Here

        table.column(new Col("second"));

        table.addRow().addContent("first column", "second column");

        StringWriter writer = new StringWriter();
        PrintStream out = new PrintStream(new WriterOutputStream(writer));
        table.print(out, false);
        out.flush();
        String expected = "first column\tsecond column\n";
        Assert.assertEquals(expected, getString(writer));
    }
View Full Code Here

        table.column(new Col("second"));

        table.addRow().addContent("first column", "second column");

        StringWriter writer = new StringWriter();
        PrintStream out = new PrintStream(new WriterOutputStream(writer));
        table.print(out, false);
        out.flush();
        String expected = "first column;second column\n";
        Assert.assertEquals(expected, getString(writer));
    }
View Full Code Here

                out = new BytesMessageOutputStream(bytesMsg);
                message = bytesMsg;
            } else {
                sw = new StringWriter();
                try {
                    out = new WriterOutputStream(sw, format.getCharSetEncoding());
                } catch (UnsupportedCharsetException ex) {
                    handleException("Unsupported encoding " + format.getCharSetEncoding(), ex);
                    return null;
                }
            }
View Full Code Here

      CharacterNormalizer procInNormalizer,
      CharacterNormalizer procOutNormalizer) throws JSchException,
      IOException, ConverterException
  {
    ReaderInputStream ris = new ReaderInputStream(in, processInCharset);
    WriterOutputStream wos = new WriterOutputStream(out, processOutCharset);
    processRequest(ris, wos);
  }
View Full Code Here

    server.addUser(OServerConfiguration.SRV_ROOT_ADMIN, null, "*");

    // Log global configuration
    if (log.isDebugEnabled()) {
      StringWriter buff = new StringWriter();
      OGlobalConfiguration.dumpConfiguration(new PrintStream(new WriterOutputStream(buff), true));
      log.debug("Global configuration:\n{}", buff);
    }

    server.activate();
    log.info("Activated");
View Full Code Here

TOP

Related Classes of org.apache.commons.io.output.WriterOutputStream

Copyright © 2018 www.massapicom. 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.