Package java.io

Examples of java.io.RandomAccessFile.readShort()


        buf.writeShort(-100);
        buf.writeShort(0x1234);
        buf.flush();

        file.seek(0);
        assertThat(file.readShort(), is((short) 100));
        assertThat(file.readShort(), is((short) -100));
        assertThat(file.readShort(), is((short) 0x1234));

        eof(file);
    }
View Full Code Here


        buf.writeShort(0x1234);
        buf.flush();

        file.seek(0);
        assertThat(file.readShort(), is((short) 100));
        assertThat(file.readShort(), is((short) -100));
        assertThat(file.readShort(), is((short) 0x1234));

        eof(file);
    }
View Full Code Here

        buf.flush();

        file.seek(0);
        assertThat(file.readShort(), is((short) 100));
        assertThat(file.readShort(), is((short) -100));
        assertThat(file.readShort(), is((short) 0x1234));

        eof(file);
    }

    /**
 
View Full Code Here

     do {
        ChangeRecord newRecord = new ChangeRecord();
        newRecord.changeLogFileName = fileName;
        newRecord.startOffset = raf.getFilePointer();
        newRecord.txid = raf.readLong();
        newRecord.type = raf.readShort();
        newRecord.timestamp = raf.readLong();
        newRecord.file = raf.readUTF();
        newRecord.endOffset = raf.getFilePointer();
        changes.add(newRecord);
        count++;
View Full Code Here

    public void test_readShort() throws IOException {
        // Test for method short java.io.RandomAccessFile.readShort()
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeShort(Short.MIN_VALUE);
        raf.seek(0);
        assertEquals("Incorrect long read/written", Short.MIN_VALUE, raf
                .readShort());
        raf.close();
    }

    /**
 
View Full Code Here

    public void test_writeShortI() throws IOException {
        // Test for method void java.io.RandomAccessFile.writeShort(int)
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeShort(Short.MIN_VALUE);
        raf.seek(0);
        assertEquals("Incorrect long read/written", Short.MIN_VALUE, raf
                .readShort());
        raf.close();
    }

    /**
 
View Full Code Here

    public void test_writeShortI() throws IOException {
        // Test for method void java.io.RandomAccessFile.writeShort(int)
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeShort(Short.MIN_VALUE);
        raf.seek(0);
        assertEquals("Incorrect long read/written", Short.MIN_VALUE, raf
                .readShort());
        raf.close();
    }

    /**
 
View Full Code Here

    public void test_readShort() throws IOException {
        // Test for method short java.io.RandomAccessFile.readShort()
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeShort(Short.MIN_VALUE);
        raf.seek(0);
        assertEquals("Incorrect long read/written", Short.MIN_VALUE, raf
                .readShort());
        raf.close();
    }

    /**
 
View Full Code Here

      do {
        ChangeRecord newRecord = new ChangeRecord();
        newRecord.changeLogFileName = fileName;
        newRecord.startOffset = raf.getFilePointer();
        newRecord.txid = raf.readLong();
        newRecord.type = raf.readShort();
        newRecord.timestamp = raf.readLong();
        newRecord.file = raf.readUTF();
        newRecord.endOffset = raf.getFilePointer();
        changes.add(newRecord);
        count++;
View Full Code Here

      // writeShort/readShort
      raf.seek(0);
      raf.writeShort(527);
      raf.seek(0);
      harness.check(raf.readShort(), 527, "writeShort(n)/readShort()");

      // writeUTF/readUTF
      raf.seek(0);
      raf.writeUTF(teststr);
      raf.seek(0);
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.