Package java.io

Examples of java.io.RandomAccessFile.writeInt()


     
      if(!file.exists()){
        //create file
        file.createNewFile();
        RandomAccessFile raf2 = new RandomAccessFile(savefile,"rw");
        raf2.writeInt(0);
        raf2.close();
        raf2 = null;
      }
      RandomAccessFile raf = new RandomAccessFile(savefile,"rw");
      int framecount = raf.readInt();
View Full Code Here


      }else{
        posToSave = framecount;
      }
      framecount++;
      raf.seek(0);//increment framecount and write back
      raf.writeInt(framecount);
      //raf.seek(raf.length());//jump to end of file
      long rewrite = 0;
      Frame preFrame=null;
      myBlockBuffer preblocks = new myBlockBuffer();
      if(posToSave>0){
View Full Code Here

      int maxx = Math.max(pos1.getBlockX(), pos2.getBlockX());
      int maxy = Math.max(pos1.getBlockY(), pos2.getBlockY());
      int maxz = Math.max(pos1.getBlockZ(), pos2.getBlockZ());
      int blockcount = (maxx-minx+1)*(maxy-miny+1)*(maxz-minz+1);
      long blockCountPos = raf.getFilePointer();
      raf.writeInt(blockcount);//write it now so i dont overwrite other stuff later
      int nowx=0,nowy=0,nowz=0,nowmat=0,nowdata=0;
      for(int xx = minx;xx<=maxx;xx++){
        for(int yy = miny;yy<=maxy;yy++){
          for(int zz = minz;zz<=maxz;zz++){
            nowx = xx-pos1.getBlockX();
View Full Code Here

            nowdata = w.getBlockAt(xx, yy, zz).getData();
            if(posToSave >0){
              myBlock preblock = preFrame.getBlockAt(nowx, nowy, nowz);
              if(preblock!= null){
                if(preblock.m.getId() != nowmat || preblock.data != nowdata ){
                  raf.writeInt(nowx);
                  raf.writeInt(nowy);
                  raf.writeInt(nowz);
                  raf.writeInt(nowmat);
                  raf.writeByte(nowdata);
                }else{
View Full Code Here

            if(posToSave >0){
              myBlock preblock = preFrame.getBlockAt(nowx, nowy, nowz);
              if(preblock!= null){
                if(preblock.m.getId() != nowmat || preblock.data != nowdata ){
                  raf.writeInt(nowx);
                  raf.writeInt(nowy);
                  raf.writeInt(nowz);
                  raf.writeInt(nowmat);
                  raf.writeByte(nowdata);
                }else{
                  blockcount--;
View Full Code Here

              myBlock preblock = preFrame.getBlockAt(nowx, nowy, nowz);
              if(preblock!= null){
                if(preblock.m.getId() != nowmat || preblock.data != nowdata ){
                  raf.writeInt(nowx);
                  raf.writeInt(nowy);
                  raf.writeInt(nowz);
                  raf.writeInt(nowmat);
                  raf.writeByte(nowdata);
                }else{
                  blockcount--;
                }
View Full Code Here

              if(preblock!= null){
                if(preblock.m.getId() != nowmat || preblock.data != nowdata ){
                  raf.writeInt(nowx);
                  raf.writeInt(nowy);
                  raf.writeInt(nowz);
                  raf.writeInt(nowmat);
                  raf.writeByte(nowdata);
                }else{
                  blockcount--;
                }
              }else{
View Full Code Here

                  raf.writeByte(nowdata);
                }else{
                  blockcount--;
                }
              }else{
                raf.writeInt(nowx);
                raf.writeInt(nowy);
                raf.writeInt(nowz);
                raf.writeInt(nowmat);
                raf.writeByte(nowdata);
              }
View Full Code Here

                }else{
                  blockcount--;
                }
              }else{
                raf.writeInt(nowx);
                raf.writeInt(nowy);
                raf.writeInt(nowz);
                raf.writeInt(nowmat);
                raf.writeByte(nowdata);
              }
            }else{
View Full Code Here

                  blockcount--;
                }
              }else{
                raf.writeInt(nowx);
                raf.writeInt(nowy);
                raf.writeInt(nowz);
                raf.writeInt(nowmat);
                raf.writeByte(nowdata);
              }
            }else{
              raf.writeInt(nowx);
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.