title: Cannot decode BASE64 to Image file in Selenium 2
body: <p>I have a BASE64 image from a screenshot capture that I would like to convert in a image.png file but there are compilation errors that I cannot understand.  </p>
  
  <pre><code>    Object ss = ((TakesScreenshot) driver).getScreenshotAs(OutputType.BASE64);
      Base64 decoder = new Base64();
      Byte[] imgBytes = (Byte[]) decoder.decode(ss);
      FileOutputStream osf = new FileOutputStream(new File("./screenshots/"+ System.getProperty("logfilename") + ".png"));        
      osf.write(imgBytes);
      osf.flush();
  </code></pre>
  
  <p>The compilation error in the code above is in the line osf.write(imgBytes) where it tells me that write() method will not accept Byte[] object because it tells me that the method only accepts write(int i) args. It is weird because when you see the options there is a write(Byte[] b). </p>
  
  <p>Could you help me solve this riddle?
  Thanks</p>