title: Read sequencefile in Hadoop 2.0
body: <p>I am trying to read a sequencefile in hadoop 2.0 but I am unable to achieve it. I am using the below code which works perfectly fine in hadoop 1.0. Please let me know if I am missing something wrt 2.0</p>
  
  <pre><code>Configuration conf = new Configuration();
  try {
  FileSystem fs = FileSystem.get(conf);
  Path p = new Path("/Users/xxx/git/xxx/src/test/cntr-20140527104344-r-00172");
  SequenceFile.Reader reader = new SequenceFile.Reader(fs,p,conf);
  Writable key = (Writable) ReflectionUtils.newInstance(reader.getKeyClass(), conf);
  Writable value = (Writable) ReflectionUtils.newInstance(reader.getValueClass(), conf);
  </code></pre>
  
  <p>I am getting the below error while trying to debug.</p>
  
  <pre><code>2014-05-28 23:30:31,567 WARN  util.NativeCodeLoader (NativeCodeLoader.java:&lt;clinit&gt;(52)) - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
  2014-05-28 23:30:31,572 INFO  compress.CodecPool (CodecPool.java:getDecompressor(121)) - Got brand-new decompressor
  java.io.EOFException
      at java.util.zip.GZIPInputStream.readUByte(GZIPInputStream.java:264)
      at java.util.zip.GZIPInputStream.readUShort(GZIPInputStream.java:254)
      at java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:163)
      at java.util.zip.GZIPInputStream.&lt;init&gt;(GZIPInputStream.java:78)
      at java.util.zip.GZIPInputStream.&lt;init&gt;(GZIPInputStream.java:90)
      at org.apache.hadoop.io.compress.GzipCodec$GzipInputStream$ResetableGZIPInputStream.&lt;init&gt;(GzipCodec.java:92)
      at org.apache.hadoop.io.compress.GzipCodec$GzipInputStream.&lt;init&gt;(GzipCodec.java:101)
      at org.apache.hadoop.io.compress.GzipCodec.createInputStream(GzipCodec.java:169)
      at org.apache.hadoop.io.compress.GzipCodec.createInputStream(GzipCodec.java:179)
      at org.apache.hadoop.io.SequenceFile$Reader.init(SequenceFile.java:1520)
      at org.apache.hadoop.io.SequenceFile$Reader.&lt;init&gt;(SequenceFile.java:1428)
      at org.apache.hadoop.io.SequenceFile$Reader.&lt;init&gt;(SequenceFile.java:1417)
      at org.apache.hadoop.io.SequenceFile$Reader.&lt;init&gt;(SequenceFile.java:1412)
      at com.xxx.bis.social.feedbehavior.cdl.Debuger.testSpliter(Debuger.java:30)
  </code></pre>
  
  <p>Kindly help.</p>
  
  <p>Note : <a href="https://stackoverflow.com/questions/16070587/reading-and-writing-sequencefile-using-hadoop-2-0-apis">Reading and Writing Sequencefile using Hadoop 2.0 Apis</a>
  I referred this link. But it did not work.</p>