Examples of WriterOutputStream


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

        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

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

        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

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

                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

Examples of org.apache.xmlgraphics.util.WriterOutputStream

        if (mediatype != null) {
            writer.write(mediatype);
        }
        writer.write(";base64,");
        Base64EncodeStream out = new Base64EncodeStream(
                new WriterOutputStream(writer, "US-ASCII"), false);
        IOUtils.copy(in, out);
        out.close();
    }
View Full Code Here

Examples of org.apache.xmlgraphics.util.WriterOutputStream

        if (mediatype != null) {
            writer.write(mediatype);
        }
        writer.write(";base64,");
        Base64EncodeStream out = new Base64EncodeStream(
                new WriterOutputStream(writer, "US-ASCII"), false);
        IOUtils.copy(in, out);
        out.close();
    }
View Full Code Here

Examples of org.eclipse.jetty.io.WriterOutputStream

       
       
        // Send the content
        OutputStream out =null;
        try {out = response.getOutputStream();}
        catch(IllegalStateException e) {out = new WriterOutputStream(response.getWriter());}

        // Has the output been wrapped
        if (!(out instanceof HttpOutput))
            // Write content via wrapped output
            resource.writeTo(out,0,resource.length());
View Full Code Here

Examples of org.freehep.util.io.WriterOutputStream

            result.append(encode);
            result.append(";base64,");

            StringWriter writer = new StringWriter();
            Base64OutputStream b64 = new Base64OutputStream(
                    new WriterOutputStream(writer));
            b64.write(imageBytes);
            b64.finish();

            result.append(writer.toString());
        }
View Full Code Here

Examples of org.glassfish.admin.rest.logviewer.WriterOutputStream

    public boolean isComplete() {
        return completed;
    }

    private long writeLogTo(long start, Writer w) throws IOException {
        return writeLogTo(start, new WriterOutputStream(w, charset));
    }
View Full Code Here

Examples of org.jboss.stdio.WriterOutputStream

            }
        }

        // make a 'nice' report
        PrintWriter writer = resp.getWriter();
        XMLEncoder encoder = new XMLEncoder(new WriterOutputStream(writer));
        encoder.writeObject(results);
        encoder.writeObject(exceptions);
        encoder.writeObject(sharedContext);
        encoder.close();
    }
View Full Code Here

Examples of org.jnode.util.WriterOutputStream

                final ShellManager sm = InitialNaming.lookup(ShellManager.NAME);
                final ConsoleManager conMgr = sm.getCurrentShell().getConsole().getManager();
                final PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
                TextConsole console = createConsoleWithShell(conMgr, out);
                System.setIn(new ReaderInputStream(console.getIn()));
                System.setOut(new PrintStream(new WriterOutputStream(console.getOut(), false), true));
                System.setErr(new PrintStream(new WriterOutputStream(console.getErr(), false), true));
            } catch (Exception ex) {
                // FIXME
                System.out.println("Problem creating the isolated console");
                ex.printStackTrace(System.err);
            }
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.