hdfs中视频文件的读取

我在hdfs中上传了一个视频文件,现在想读取视频文件的一些信息

   String uri = "hdfs://master:9000/input/video1.mp4";
      Configuration conf = new Configuration();
      FileSystem fs = FileSystem.get(URI.create(uri), conf);
      InputStream in = null;
       try {
            in = fs.open(new Path(uri));
        }finally {      
            }
        File source = null;
        inputstreamtofile(in,source);
   Encoder encoder = new Encoder();
   try {
      MultimediaInfo m = encoder.getInfo(source);
      long ls = m.getDuration();
      System.out.println("此视频时长为:"+ls/60000+"分"+(ls/000)/1000+"秒!");
   } catch(Exception e) {
     e.printStackTrace();
   }

其中 inputstreamtofile是想将数据流转化为File
public static void inputstreamtofile(InputStream in,File sor) throws IOException{
OutputStream os = new FileOutputStream(sor);
int bytesRead = 0;
byte[] buffer = new byte[19230720];
while ((bytesRead = in.read(buffer, 0, 19230720)) != -1) {
os.write(buffer, 0, bytesRead);
}
os.close();
in.close();
}

但是运行时候会有空指针异常
Exception in thread "main" java.lang.NullPointerException
at java.io.FileOutputStream.(FileOutputStream.java:212)
at java.io.FileOutputStream.(FileOutputStream.java:171)
at mapreduce.readvideoinfo.inputstreamtofile(readvideoinfo.java:20)
at mapreduce.readvideoinfo.main(readvideoinfo.java:40)

这个应该怎么改呢

http://blog.csdn.net/kerenigma/article/details/8129519