import java.io.*; 

public class TestRead {
  public static void main(String[] args) {
    if (args.length > 0) {
      try {
	ObjectRandomAccessFile in = new ObjectRandomAccessFile(args[0], "r"); 
	Object obj; 
	long offset; 
	for (int i = 1; i < args.length; i++) {
	  offset = Long.parseLong(args[i]);
	  in.seek(offset);  
	  obj = in.readObject(); 
	  System.out.println(obj + " read at offset " + offset); 
	}
      } catch (Exception e) {}
    }
  }
}