Package java.io

Examples of java.io.RandomAccessFile.readChar()


    public void test_readChar() throws IOException {
        // Test for method char java.io.RandomAccessFile.readChar()
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeChar('T');
        raf.seek(0);
        assertEquals("Incorrect char read/written", 'T', raf.readChar());
        raf.close();
    }

    /**
     * @tests java.io.RandomAccessFile#readDouble()
View Full Code Here


    public void test_writeCharI() throws IOException {
        // Test for method void java.io.RandomAccessFile.writeChar(int)
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeChar('T');
        raf.seek(0);
        assertEquals("Incorrect char read/written", 'T', raf.readChar());
        raf.close();
    }

    /**
     * @tests java.io.RandomAccessFile#writeChars(java.lang.String)
View Full Code Here

        raf.writeChars("HelloWorld");
        char[] hchars = new char[10];
        "HelloWorld".getChars(0, 10, hchars, 0);
        raf.seek(0);
        for (int i = 0; i < hchars.length; i++)
            assertEquals("Incorrect string written", hchars[i], raf.readChar());
        raf.close();
    }

    /**
     * @tests java.io.RandomAccessFile#writeDouble(double)
View Full Code Here

    public void test_readChar() throws IOException {
        // Test for method char java.io.RandomAccessFile.readChar()
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeChar('T');
        raf.seek(0);
        assertEquals("Incorrect char read/written", 'T', raf.readChar());
        raf.close();
    }

    /**
     * @tests java.io.RandomAccessFile#readDouble()
View Full Code Here

    public void test_writeCharI() throws IOException {
        // Test for method void java.io.RandomAccessFile.writeChar(int)
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeChar('T');
        raf.seek(0);
        assertEquals("Incorrect char read/written", 'T', raf.readChar());
        raf.close();
    }

    /**
     * @tests java.io.RandomAccessFile#writeChars(java.lang.String)
View Full Code Here

        raf.writeChars("HelloWorld");
        char[] hchars = new char[10];
        "HelloWorld".getChars(0, 10, hchars, 0);
        raf.seek(0);
        for (int i = 0; i < hchars.length; i++)
            assertEquals("Incorrect string written", hchars[i], raf.readChar());
        raf.close();
    }

    /**
     * @tests java.io.RandomAccessFile#writeDouble(double)
View Full Code Here

    public void test_writeCharI() throws IOException {
        // Test for method void java.io.RandomAccessFile.writeChar(int)
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeChar('T');
        raf.seek(0);
        assertEquals("Incorrect char read/written", 'T', raf.readChar());
        raf.close();
    }

    /**
     * @tests java.io.RandomAccessFile#writeChars(java.lang.String)
View Full Code Here

        raf.writeChars("HelloWorld");
        char[] hchars = new char[10];
        "HelloWorld".getChars(0, 10, hchars, 0);
        raf.seek(0);
        for (int i = 0; i < hchars.length; i++)
            assertEquals("Incorrect string written", hchars[i], raf.readChar());
        raf.close();
    }

    /**
     * @tests java.io.RandomAccessFile#writeDouble(double)
View Full Code Here

    public void test_readChar() throws IOException {
        // Test for method char java.io.RandomAccessFile.readChar()
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeChar('T');
        raf.seek(0);
        assertEquals("Incorrect char read/written", 'T', raf.readChar());
        raf.close();
    }

    /**
     * @tests java.io.RandomAccessFile#readDouble()
View Full Code Here

    public void test_writeCharI() throws IOException {
        // Test for method void java.io.RandomAccessFile.writeChar(int)
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeChar('T');
        raf.seek(0);
        assertEquals("Incorrect char read/written", 'T', raf.readChar());
        raf.close();
    }

    /**
     * @tests java.io.RandomAccessFile#writeChars(java.lang.String)
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.