Package org.jruby.embed.io

Examples of org.jruby.embed.io.ReaderInputStream.available()


    @Test
    public void testAvailable() throws Exception {
        logger1.info("available");
        ReaderInputStream instance = new ReaderInputStream(new FileReader(filename));
        int expResult = 40;
        int result = instance.available();
        assertEquals(expResult, result);
        instance.close();
    }

    /**
 
View Full Code Here


    @Test
    public void testRead_3args_bigfile() throws Exception {
        logger1.info("read 3args big file");
        StringBuffer sb = new StringBuffer();
        ReaderInputStream instance = new ReaderInputStream(new FileReader(filename2));
        while (instance.available() > 0) {
            byte[] buf = new byte[1024];
            int size = instance.read(buf, 0, buf.length);
            if (size != -1) {
                sb.append(new String(buf));
            }
View Full Code Here

    @Test
    public void testAvailable() throws Exception {
        logger1.info("available");
        ReaderInputStream instance = new ReaderInputStream(new FileReader(filename));
        int expResult = 40;
        int result = instance.available();
        assertEquals(expResult, result);
        instance.close();
    }

    /**
 
View Full Code Here

    @Test
    public void testRead_3args_bigfile() throws Exception {
        logger1.info("read 3args big file");
        StringBuffer sb = new StringBuffer();
        ReaderInputStream instance = new ReaderInputStream(new FileReader(filename2));
        while (instance.available() > 0) {
            byte[] buf = new byte[1024];
            int size = instance.read(buf, 0, buf.length);
            if (size != -1) {
                sb.append(new String(buf));
            }
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.