   public static void readSequenceFile(String seqFile) throws IOException{
 
        Path readPath = new Path(seqFile);
        Configuration conf = new Configuration(false);
        FileSystem fs = FileSystem.get(URI.create(seqFile), conf);
 
        SequenceFile.Reader reader = null;
 
        try{
          reader = new SequenceFile.Reader(conf, SequenceFile.Reader.file(readPath));
          Writable key = (Writable)ReflectionUtils.newInstance(reader.getKeyClass(), conf);
          Writable value = (Writable)ReflectionUtils.newInstance(reader.getValueClass(), conf);
 
          while(reader.next(key,value)){
              System.out.println("key: " + key.toString());
              if(reader.syncSeen()){
                  System.out.println("sync: ");
              }
 
          }
        }
        catch(IOException ioEx){
            ioEx.printStackTrace();
        }
        finally{
            if(reader !=  null){
             reader.close();
            }
        }
 
    }
 
 
     public static void main(String[] args){
 
        try{
         writeSequenceFile(args[0], args[1]);
         readSequenceFile(args[1]);
        }
        catch(IOException ioEx){
            ioEx.printStackTrace();
        }
 
     }
 
 }
 
 
