Package java.io

Examples of java.io.RandomAccessFile.writeChars()


     */
    public void test_writeCharsLjava_lang_String() throws IOException {
        // Test for method void
        // java.io.RandomAccessFile.writeChars(java.lang.String)
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        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());
View Full Code Here


            lock = channel.tryLock();
        } catch (final OverlappingFileLockException e) {
            stream.close();
            channel.close();
        }
        stream.writeChars("test lock");
        lock.release();

        stream.close();
        channel.close();
    }
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.