Code example for RandomAccessFile

Methods: readInt, seek

0
      } 
      return result;
    } 
 
    static int readInt(RandomAccessFile file, long offset) throws IOException {
      file.seek(offset);
      return Integer.reverseBytes(file.readInt());
    } 
 
    static void readBytes(RandomAccessFile file, long offset, byte[] result, int length)
        throws IOException { 
      file.seek(offset);
      file.read(result, 0, length);
    } 
  } 
 
  /** 
   * See http://www.pkware.com/documents/casestudies/APPNOTE.TXT 
   * I.  End of central directory record 
   */ 
  private static class EndOfCentralDirectory {