Package java.io

Examples of java.io.RandomAccessFile.readLong()


            RandomAccessFile raf = new RandomAccessFile(backingFile,"r");
            long offset = raf.length();
            while(offset > 0) {
                offset-=8;
                raf.seek(offset);
                reverted.writeLong(raf.readLong());
            }
        }
        reverted.startReading();
        return reverted;
    }
View Full Code Here


        try {
          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)");
          timestamp1 = activeRandomAccessFile.readLong();
        }
        finally {
          activeRandomAccessFile.close();
        }
View Full Code Here

        activeRandomAccessFile = new RandomAccessFile(file2, "r");
        try {
          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();
 
          if (timestamp1 > timestamp2) {
              return file1;
          } else {
              return file2;
View Full Code Here

            dest.write(buffer);
        }

        dest.seek(DataFileCache.LONG_FREE_POS_POS);

        long length = dest.readLong();

        JavaSystem.setRAFileLength(dest, length);
        source.close();
        dest.close();
    }
View Full Code Here

            RandomAccessFile raf = null;
            try {
                File indexFileName = getIndexFile();
                raf = new RandomAccessFile(indexFileName, "r");

                long fileStamp = raf.readLong();
                if (zipFile.lastModified() != fileStamp) {
                    ret = false;
                } else {
                    directories = new HashMap<RelativeDirectory, DirectoryEntry>();
                    int numDirs = raf.readInt();
View Full Code Here

                        raf.read(dirNameBytes);

                        RelativeDirectory dirNameStr = getRelativeDirectory(new String(dirNameBytes, "UTF-8"));
                        DirectoryEntry de = new DirectoryEntry(dirNameStr, this);
                        de.numEntries = raf.readInt();
                        de.writtenOffsetOffset = raf.readLong();
                        directories.put(dirNameStr, de);
                    }
                    ret = true;
                    zipFileLastModified = fileStamp;
                }
View Full Code Here

                            // Read compressed size of the file in the real Jar/Zip file
                            int eCsize = raf.readInt();

                            // Read java time stamp of the file in the real Jar/Zip file
                            long eJavaTimestamp = raf.readLong();

                            Entry rfie = new Entry(dirName, eName);
                            rfie.isDir = eIsDir;
                            rfie.offset = eOffset;
                            rfie.size = eSize;
View Full Code Here

                    }
             */

            psinfo.seek(areWe64?0xEC:0xBC)// now jump to pr_argc
            int argc = adjust(psinfo.readInt());
            long argp = areWe64?adjust(psinfo.readLong()):to64(adjust(psinfo.readInt()));
            if(LOGGER.isLoggable(FINEST))
                LOGGER.finest(String.format("argc=%d,argp=%X",argc,argp));

            File asFile = new File("/proc/" + pid + "/as");
            if (areWe64) {
View Full Code Here

            RandomAccessFile raf = null;
            try {
                File indexFileName = getIndexFile();
                raf = new RandomAccessFile(indexFileName, "r");

                long fileStamp = raf.readLong();
                if (zipFile.lastModified() != fileStamp) {
                    ret = false;
                } else {
                    directories = new HashMap<RelativeDirectory, DirectoryEntry>();
                    int numDirs = raf.readInt();
View Full Code Here

                        raf.read(dirNameBytes);

                        RelativeDirectory dirNameStr = getRelativeDirectory(new String(dirNameBytes, "UTF-8"));
                        DirectoryEntry de = new DirectoryEntry(dirNameStr, this);
                        de.numEntries = raf.readInt();
                        de.writtenOffsetOffset = raf.readLong();
                        directories.put(dirNameStr, de);
                    }
                    ret = true;
                    zipFileLastModified = fileStamp;
                }
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.