Method to write byte[] to image its working

private static void writeImage(byte [] b, String filename) throws Exception{
//InputStream sImage=;
FileOutputStream outStream = new...