Examples of WriterOutputStream


Examples of org.jnode.util.WriterOutputStream

    @Test
    public void testBadUnicode4() throws Exception {
        byte[] BAD = new byte[] {(byte) 'h', (byte) 'i', (byte) 0xc2};
        StringWriter sw = new StringWriter();
        WriterOutputStream wos = new WriterOutputStream(sw, "UTF-8", true);
        wos.write(BAD);
        wos.flush();
        try {
            wos.close();
            Assert.fail("no exception thrown");
        } catch (MalformedInputException ex) {
            // expected
            Assert.assertEquals("hi", sw.getBuffer().toString());
        }
View Full Code Here

Examples of org.jnode.util.WriterOutputStream

            console.setAcceleratorKeyCode(KeyEvent.VK_F7);
            final VirtualConsoleAppender debugApp =
                new VirtualConsoleAppender(new PatternLayout(LAYOUT), console, false);
            debugApp.setThreshold(Level.DEBUG);
            BootLogInstance.get().setDebugOut(new PrintStream(new WriterOutputStream(console.getOut(), false), true));

            TextConsole atc = new ActiveTextConsole(conMgr);
            final VirtualConsoleAppender infoApp = new VirtualConsoleAppender(
                    new PatternLayout(LAYOUT), atc, false);
            infoApp.setThreshold(Level.INFO);
View Full Code Here

Examples of org.jnode.util.WriterOutputStream

        this.screen = screen;
        this.scrWidth = screen.getWidth();
        this.scrHeight = screen.getHeight();
        this.out = new ConsoleWriter(this, 0x07);
        this.err = new ConsoleWriter(this, 0x04);
        this.savedOut = new PrintStream(new WriterOutputStream(this.out, false), true);
        this.savedErr = new PrintStream(new WriterOutputStream(this.err, false), true);
        this.claimSystemOutErr = false;
        this.myIsolate = VmIsolate.currentIsolate();
    }
View Full Code Here

Examples of org.jnode.util.WriterOutputStream

                null,
                (ConsoleManager.CreateOptions.TEXT |
                    ConsoleManager.CreateOptions.SCROLLABLE));
            first.setAcceleratorKeyCode(KeyEvent.VK_F1);
            mgr.focus(first);
            System.setOut(new PrintStream(new WriterOutputStream(first.getOut(), false), true));
            System.setErr(new PrintStream(new WriterOutputStream(first.getErr(), false), true));
            System.out.println(VmSystem.getBootLog());
        } catch (ConsoleException ex) {
            throw new PluginException(ex);
        } catch (NamingException ex) {
            throw new PluginException(ex);
View Full Code Here

Examples of org.jnode.util.WriterOutputStream

    }

    public synchronized OutputStream getOutputStream() {
        if (outputStream == null) {
            boolean isConsole = writer instanceof ShellConsoleWriter;
            outputStream = new WriterOutputStream(writer, getEncoding(), !isConsole);
        }
        return outputStream;
    }
View Full Code Here

Examples of org.jruby.embed.io.WriterOutputStream

     */
    public void setOutput(Writer writer) {
        if (writer == null) {
            provider.getRubyInstanceConfig().setOutput(null);
        } else {
            WriterOutputStream ostream = new WriterOutputStream(writer);
            PrintStream pstream = new PrintStream(ostream);
            provider.getRubyInstanceConfig().setOutput(pstream);
        }
    }
View Full Code Here

Examples of org.jruby.embed.io.WriterOutputStream

     */
    public void setError(Writer writer) {
        if (writer == null) {
            provider.getRubyInstanceConfig().setError(null);
        } else {
            WriterOutputStream ostream = new WriterOutputStream(writer);
            PrintStream pstream = new PrintStream(ostream);
            provider.getRubyInstanceConfig().setError(pstream);
        }
    }
View Full Code Here

Examples of org.jruby.embed.io.WriterOutputStream

            if (old == writer) {
                return;
            }
        }
        map.put(AttributeName.WRITER, writer);
        PrintStream pstream = new PrintStream(new WriterOutputStream(writer));
        setOutputStream(pstream);
    }
View Full Code Here

Examples of org.jruby.embed.io.WriterOutputStream

            if (old == errorWriter) {
                return;
            }
        }
        map.put(AttributeName.ERROR_WRITER, errorWriter);
        PrintStream pstream = new PrintStream(new WriterOutputStream(errorWriter));
        setErrorStream(pstream);
    }
View Full Code Here

Examples of org.kohsuke.stapler.framework.io.WriterOutputStream

     *      if the file is still being written, this method writes the file
     *      until the last newline character and returns the offset to start
     *      the next write operation.
     */
    public long writeLogTo(long start, Writer w) throws IOException {
        CountingOutputStream os = new CountingOutputStream(new WriterOutputStream(w));

        Session f = source.open();
        f.skip(start);

        if(completed) {
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.