Package java.io

Examples of java.io.RandomAccessFile.readLong()


      int count = 0;
      do {
        ChangeRecord newRecord = new ChangeRecord();
        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);
View Full Code Here


        ChangeRecord newRecord = new ChangeRecord();
        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());
View Full Code Here

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

        activeRandomAccessFile = new RandomAccessFile(file2, "r");
        int formatId2 = activeRandomAccessFile.readInt();
        if (formatId2 != BitronixXid.FORMAT_ID)
View Full Code Here

        activeRandomAccessFile = new RandomAccessFile(file2, "r");
        int formatId2 = activeRandomAccessFile.readInt();
        if (formatId2 != BitronixXid.FORMAT_ID)
            throw new IOException("log file 2 " + file2.getName() + " is not a Bitronix Log file (incorrect header)");
        long timestamp2 = activeRandomAccessFile.readLong();
        activeRandomAccessFile.close();

        if (timestamp1 > timestamp2) {
            return file1;
        } else {
View Full Code Here

      }

      @Override
      public long readLong() throws IOException
      {
        return f.readLong();
      }

      @Override
      public void write(byte[] bytes, int length) throws IOException
      {
View Full Code Here

    public void test_readLong() throws IOException {
        // Test for method long java.io.RandomAccessFile.readLong()
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeLong(Long.MAX_VALUE);
        raf.seek(0);
        assertEquals("Incorrect long read/written", Long.MAX_VALUE, raf
                .readLong());
        raf.close();
    }

    /**
 
View Full Code Here

    public void test_writeLongJ() throws IOException {
        // Test for method void java.io.RandomAccessFile.writeLong(long)
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeLong(Long.MAX_VALUE);
        raf.seek(0);
        assertEquals("Incorrect long read/written", Long.MAX_VALUE, raf
                .readLong());
        raf.close();
    }

    /**
 
View Full Code Here

    public void test_writeLongJ() throws IOException {
        // Test for method void java.io.RandomAccessFile.writeLong(long)
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeLong(Long.MAX_VALUE);
        raf.seek(0);
        assertEquals("Incorrect long read/written", Long.MAX_VALUE, raf
                .readLong());
        raf.close();
    }

    /**
 
View Full Code Here

    public void test_readLong() throws IOException {
        // Test for method long java.io.RandomAccessFile.readLong()
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeLong(Long.MAX_VALUE);
        raf.seek(0);
        assertEquals("Incorrect long read/written", Long.MAX_VALUE, raf
                .readLong());
        raf.close();
    }

    /**
 
View Full Code Here

    public void test_writeLongJ() throws IOException {
        // Test for method void java.io.RandomAccessFile.writeLong(long)
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeLong(Long.MAX_VALUE);
        raf.seek(0);
        assertEquals("Incorrect long read/written", Long.MAX_VALUE, raf
                .readLong());
        raf.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.