Package java.io

Examples of java.io.RandomAccessFile.readBoolean()


        buf.writeBoolean(false);
        buf.writeBoolean(true);
        buf.flush();

        file.seek(0);
        assertThat(file.readBoolean(), is(false));
        assertThat(file.readBoolean(), is(true));

        eof(file);
    }
View Full Code Here


        buf.writeBoolean(true);
        buf.flush();

        file.seek(0);
        assertThat(file.readBoolean(), is(false));
        assertThat(file.readBoolean(), is(true));

        eof(file);
    }

    /**
 
View Full Code Here

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

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

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

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

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

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

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

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

      // 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
      raf.seek(0);
      raf.writeShort(527);
View Full Code Here

      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
      raf.seek(0);
      raf.writeShort(527);
      raf.seek(0);
View Full Code Here

      throw new IllegalArgumentException("this is not a cinema restoration file");
    }
    int version = raf.readInt();
    switch(version){
    case 0:
      boolean oneSet = raf.readBoolean();
      if(oneSet){
        int x = raf.readInt();
        int y = raf.readInt();
        int z = raf.readInt();
        World world = Bukkit.getWorld(raf.readUTF());
View Full Code Here

        World world = Bukkit.getWorld(raf.readUTF());
        if(world != null){
          cinema.getRegion().setPos1(new Location(world,x,y,z));
        }
      }
      boolean twoSet = raf.readBoolean();
      if(twoSet){
        int x = raf.readInt();
        int y = raf.readInt();
        int z = raf.readInt();
        World world = Bukkit.getWorld(raf.readUTF());
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.