title: text file to image conversion
body: <p>I have a string, which i am converting it into bytes[] and then i code it to bring back to image but the problem is that it is not creating it back to the image</p>
  
  <pre><code>              BufferedReader reader2 = new BufferedReader(new FileReader("e:\\imageinString.txt"));
      String buffer, lined = "";
  
      while ((buffer = reader2.readLine()) != null) {
          lined = lined + buffer;
      }
  
      byte[] byteArray = lined.getBytes("UTF-16");
  
      InputStream in = new ByteArrayInputStream(byteArray);
      BufferedImage bImageFromConvert = ImageIO.read(in);
  
      ImageIO.write(bImageFromConvert, "bmp", new File("e:\\ppp.bmp"));
      reader2.close();
  </code></pre>
  
  <p>I am getting this error but I am getting this on console</p>
  
  <pre><code>     Exception in thread "main" java.lang.IllegalArgumentException: image == null!
  at javax.imageio.ImageTypeSpecifier.createFromRenderedImage(ImageTypeSpecifier.java:925)
  at javax.imageio.ImageIO.getWriter(ImageIO.java:1591)
  at javax.imageio.ImageIO.write(ImageIO.java:1520)
  at imagereading.Imagereading.main(Imagereading.java:47)
  </code></pre>