Package java.io

Examples of java.io.RandomAccessFile.readInt()


      raf.seek(0);//increment framecount and write back
      raf.writeInt(framecount);
      //raf.seek(raf.length());//jump to end of file
      long rewrite = 0;
      for(int i =0;i< posToSafe;i++){
        int blocks = raf.readInt();
        raf.seek(raf.getFilePointer()+17*blocks);//each block 4 ints and one byte = 17
      }
      rewrite = raf.getFilePointer();//store pos to write frame
      byte[] ba = new byte[(int)(raf.length()-rewrite)];
      for(int i =0;i<ba.length;i++){
View Full Code Here


    String id = raf.readUTF();
    if(!id.equals(fileID)){
      raf.close();
      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();
View Full Code Here

    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());
        if(world != null){
          cinema.getRegion().setPos1(new Location(world,x,y,z));
View Full Code Here

    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());
        if(world != null){
          cinema.getRegion().setPos1(new Location(world,x,y,z));
        }
View Full Code Here

    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());
        if(world != null){
          cinema.getRegion().setPos1(new Location(world,x,y,z));
        }
      }
View Full Code Here

          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());
        if(world != null){
          cinema.getRegion().setPos2(new Location(world,x,y,z));
View Full Code Here

        }
      }
      boolean twoSet = raf.readBoolean();
      if(twoSet){
        int x = raf.readInt();
        int y = raf.readInt();
        int z = raf.readInt();
        World world = Bukkit.getWorld(raf.readUTF());
        if(world != null){
          cinema.getRegion().setPos2(new Location(world,x,y,z));
        }
View Full Code Here

      }
      boolean twoSet = raf.readBoolean();
      if(twoSet){
        int x = raf.readInt();
        int y = raf.readInt();
        int z = raf.readInt();
        World world = Bukkit.getWorld(raf.readUTF());
        if(world != null){
          cinema.getRegion().setPos2(new Location(world,x,y,z));
        }
      }
View Full Code Here

        World world = Bukkit.getWorld(raf.readUTF());
        if(world != null){
          cinema.getRegion().setPos2(new Location(world,x,y,z));
        }
      }
      int count = raf.readInt();
      for(int i =0; i< count; i++){
        cinema.getPlayers().add(new CinemaPlayer(cinema, raf));
      }
      break;
    default:
View Full Code Here

    }

    public static File pickCurrentLogFile(File file1, File file2) throws IOException {
        RandomAccessFile activeRandomAccessFile;
        activeRandomAccessFile = new RandomAccessFile(file1, "r");
        int formatId1 = activeRandomAccessFile.readInt();
        if (formatId1 != BitronixXid.FORMAT_ID)
            throw new IOException("log file 1 " + file1.getName() + " is not a Bitronix Log file (incorrect header)");
        long timestamp1 = activeRandomAccessFile.readLong();
        activeRandomAccessFile.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.