Package org.jnode.util

Examples of org.jnode.util.WriterOutputStream


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


    @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

            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

        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

                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

    }

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

TOP

Related Classes of org.jnode.util.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.