Code example for RandomAccessFile

Methods: readUnsignedShort, seek

0
      in.read(result);
      return result;
    } 
 
    private static int read16(RandomAccessFile in, long loc) throws IOException {
      in.seek(loc);
      return in.readUnsignedShort();
    } 
 
    private static int read32(RandomAccessFile in, long loc) throws IOException {
      in.seek(loc);
      return in.readInt();
    } 
 
    static int table1[] = {
      -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 
      -1, -1, 0, 1, -1, -1, 0, 1, -1, -1, 0, 1, -1, -1, 0, 1, 
      -1, -1, -1, -1, 0, 1, 1, 2, -1, -1, -1, -1, 0, 1, 1, 2, 
      -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 1, 2, 2, 3 
    };