Package java.io

Examples of java.io.RandomAccessFile.readUTF()


        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++;
      }while (count < MAX_ENTRIES_TO_READ && raf.getFilePointer()< raf.length());
    } catch (FileNotFoundException e)
View Full Code Here


        // Test for method java.lang.String java.io.RandomAccessFile.readUTF()

        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeUTF(unihw);
        raf.seek(0);
        assertEquals("Incorrect utf string read", unihw, raf.readUTF());
        raf.close();
    }

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

        // Test for method void
        // java.io.RandomAccessFile.writeUTF(java.lang.String)
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeUTF(unihw);
        raf.seek(0);
        assertEquals("Incorrect utf string", unihw, raf.readUTF());
        raf.close();
    }

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

        // Test for method void
        // java.io.RandomAccessFile.writeUTF(java.lang.String)
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeUTF(unihw);
        raf.seek(0);
        assertEquals("Incorrect utf string", unihw, raf.readUTF());
        raf.close();
    }

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

        // Test for method java.lang.String java.io.RandomAccessFile.readUTF()

        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeUTF(unihw);
        raf.seek(0);
        assertEquals("Incorrect utf string read", unihw, raf.readUTF());
        raf.close();
    }

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

        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++;
      } while (count < MAX_ENTRIES_TO_READ && raf.getFilePointer() < raf.length());
    } catch (FileNotFoundException e) {
View Full Code Here

      raf.seek(0);
      raf.writeUTF(teststr);
      raf.seek(0);
      harness.check(raf.readShort(), testlength, "writeUTF(s): length encoding");
      raf.seek(0);
      harness.check(raf.readUTF(), teststr,
                    "writeUTF(s)/readUTF: string recovery");

      // writeBytes/readLine
      // N.B.: This test actually tests to the JDK1.2 specification.  JDK1.1 says, in part:
      //   The line-terminating character(s), if any, are included as part of the string returned.
View Full Code Here

  public CinemaFile(File file) throws IOException{
    this.file = file;
    this.name = file.getName();
    if(file.exists()){
      RandomAccessFile raf = new RandomAccessFile(file, "r");
      String id = raf.readUTF();
      if(!fileID.equals(id)){
        raf.close();
        throw new IllegalArgumentException("this is not a cinema animation");
      }
      int version = raf.readInt();
View Full Code Here

  private Cinema cinema;
 
  public RestorationFile(Cinema cinema, File file) throws IOException{
    this.cinema = cinema;
    RandomAccessFile raf = new RandomAccessFile(file, "r");
    String id = raf.readUTF();
    if(!id.equals(fileID)){
      raf.close();
      throw new IllegalArgumentException("this is not a cinema restoration file");
    }
    int version = raf.readInt();
View Full Code Here

      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));
        }
      }
      boolean twoSet = raf.readBoolean();
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.