Examples of writeChar()


Examples of java.io.ObjectOutput.writeChar()

        for (int i = 0; i < 10; i++)
        {
            output.writeUTF("Test" + i);
        }

        output.writeChar(55);

        output.writeLong(5);

        for (int i = 0; i < 10; i++)
        {
View Full Code Here

Examples of java.io.ObjectOutputStream.writeChar()

    oos.writeDouble(Double.NaN);
   
    byte[] bytes = new byte[] {-1,2,-3,4,-5};
    oos.writeObject(bytes);
    oos.writeByte(100);
    oos.writeChar('X');
    oos.close();

    streamData = os.toByteArray();
   
    harness.check(streamData.length, 76, "Stream length");
View Full Code Here

Examples of java.io.ObjectOutputStream.writeChar()

    private byte [] marshallThingy(DataObject thingy ) throws IOException {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream stream = new ObjectOutputStream(baos);

        stream.writeChar(thingy.type);
        stream.writeLong(thingy.time);
        if( thingy.intCount != null ) {
            stream.writeInt(thingy.intCount);
        }
        else if( thingy.strCount != null ) {
View Full Code Here

Examples of java.io.RandomAccessFile.writeChar()

        // a different VM could get the same file name.
        try
        {
            RandomAccessFile file;
            file = new RandomAccessFile(exceptionFile, "rw");
            file.writeChar('t');
            file.close();
        }
        catch (Exception ex)
        {
            // ignore
View Full Code Here

Examples of java.io.RandomAccessFile.writeChar()

     * @throws Exception if failed
     */
    @Test
    public void testReadChar() throws Exception {
        RandomAccessFile file = file();
        file.writeChar('a');
        file.writeChar(0xa000);
        file.seek(0);

        BufferedFileInput buf = manage(new BufferedFileInput(file, 256));
        assertThat(buf.readChar(), is('a'));
View Full Code Here

Examples of java.io.RandomAccessFile.writeChar()

     */
    @Test
    public void testReadChar() throws Exception {
        RandomAccessFile file = file();
        file.writeChar('a');
        file.writeChar(0xa000);
        file.seek(0);

        BufferedFileInput buf = manage(new BufferedFileInput(file, 256));
        assertThat(buf.readChar(), is('a'));
        assertThat(buf.readChar(), is((char) 0xa000));
View Full Code Here

Examples of java.io.RandomAccessFile.writeChar()

     * @tests 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();
    }

View Full Code Here

Examples of java.io.RandomAccessFile.writeChar()

     * @tests java.io.RandomAccessFile#writeChar(int)
     */
    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();
    }

View Full Code Here

Examples of java.io.RandomAccessFile.writeChar()

     * @tests java.io.RandomAccessFile#writeChar(int)
     */
    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();
    }

View Full Code Here

Examples of java.io.RandomAccessFile.writeChar()

     * @tests 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();
    }

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.