title: How to use Hadoop InputFormats In Apache Spark?
body: <p>I have a class <code>ImageInputFormat</code> in Hadoop which reads images from HDFS. How to use my InputFormat in Spark?</p>
  
  <p>Here is my <code>ImageInputFormat</code>:</p>
  
  <pre><code>public class ImageInputFormat extends FileInputFormat&lt;Text, ImageWritable&gt; {
  
      @Override
      public ImageRecordReader createRecordReader(InputSplit split, 
                    TaskAttemptContext context) throws IOException, InterruptedException {
          return new ImageRecordReader();
      }
  
      @Override
      protected boolean isSplitable(JobContext context, Path filename) {
          return false;
      }
  }  
  </code></pre>