Package java.io

Examples of java.io.RandomAccessFile.writeBoolean()


            nt[0] = '\0';

            /* DKS. Can't write structure because of pad bytes */
            /* fwrite(&head, sizeof(head), 1, fout); */

            fout.writeBoolean(head.endian); // Big Endian - should
            // match head.endian
            fout.writeShort(RpfHeader.HEADER_SECTION_LENGTH);
            fout.writeBytes("       A.TOC"); // has to be padded.
            fout.writeByte(head.neww);

View Full Code Here


     * @throws Exception if failed
     */
    @Test
    public void testReadBoolean() throws Exception {
        RandomAccessFile file = file();
        file.writeBoolean(false);
        file.writeBoolean(true);
        file.seek(0);

        BufferedFileInput buf = manage(new BufferedFileInput(file, 256));
        assertThat(buf.readBoolean(), is(false));
View Full Code Here

     */
    @Test
    public void testReadBoolean() throws Exception {
        RandomAccessFile file = file();
        file.writeBoolean(false);
        file.writeBoolean(true);
        file.seek(0);

        BufferedFileInput buf = manage(new BufferedFileInput(file, 256));
        assertThat(buf.readBoolean(), is(false));
        assertThat(buf.readBoolean(), is(true));
View Full Code Here

     * @tests java.io.RandomAccessFile#readBoolean()
     */
    public void test_readBoolean() throws IOException {
        // Test for method boolean java.io.RandomAccessFile.readBoolean()
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeBoolean(true);
        raf.seek(0);
        assertTrue("Incorrect boolean read/written", raf.readBoolean());
        raf.close();
    }

View Full Code Here

     * @tests java.io.RandomAccessFile#writeBoolean(boolean)
     */
    public void test_writeBooleanZ() throws IOException {
        // Test for method void java.io.RandomAccessFile.writeBoolean(boolean)
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeBoolean(true);
        raf.seek(0);
        assertTrue("Incorrect boolean read/written", raf.readBoolean());
        raf.close();
    }

View Full Code Here

     * @tests java.io.RandomAccessFile#readBoolean()
     */
    public void test_readBoolean() throws IOException {
        // Test for method boolean java.io.RandomAccessFile.readBoolean()
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeBoolean(true);
        raf.seek(0);
        assertTrue("Incorrect boolean read/written", raf.readBoolean());
        raf.close();
    }

View Full Code Here

     * @tests java.io.RandomAccessFile#writeBoolean(boolean)
     */
    public void test_writeBooleanZ() throws IOException {
        // Test for method void java.io.RandomAccessFile.writeBoolean(boolean)
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeBoolean(true);
        raf.seek(0);
        assertTrue("Incorrect boolean read/written", raf.readBoolean());
        raf.close();
    }

View Full Code Here

      raf.seek(0);
      harness.check(raf.readByte(), -12, "writeByte(byte)/readByte(), negative");

      // writeBoolean/readBoolean
      raf.seek(0);
      raf.writeBoolean(true);
      raf.writeBoolean(false);
      raf.seek(0);
      harness.check(raf.readBoolean(), "writeBoolean(T)/readBoolean()");
      harness.check(!raf.readBoolean(), "writeBoolean(F)/readBoolean()");
View Full Code Here

      harness.check(raf.readByte(), -12, "writeByte(byte)/readByte(), negative");

      // writeBoolean/readBoolean
      raf.seek(0);
      raf.writeBoolean(true);
      raf.writeBoolean(false);
      raf.seek(0);
      harness.check(raf.readBoolean(), "writeBoolean(T)/readBoolean()");
      harness.check(!raf.readBoolean(), "writeBoolean(F)/readBoolean()");

      // writeShort/readShort
View Full Code Here

    raf.writeInt(fileVersion);
   
    Region reg = cinema.getRegion();
    boolean oneSet = reg.getPos1() != null;
    boolean twoSet = reg.getPos2() != null;
    raf.writeBoolean(oneSet);
    if(oneSet){
      raf.writeInt(reg.getPos1().getBlockX());
      raf.writeInt(reg.getPos1().getBlockY());
      raf.writeInt(reg.getPos1().getBlockZ());
      raf.writeUTF(reg.getPos1().getWorld().getName());
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.