title: how to avoid the unchecked call warning in java for a java.util.HashMap
body: <p>I am storing an image as a string and converting it to a JSONObject and storing it in a json file and at last i'm reading from the same json file and retrieving the string as an image.In this process i get an warning</p>
  
  <blockquote>
    <p>Simple.java:29: warning: [unchecked] unchecked call to put(K,V) as a member of the raw type java.util.HashMap
           fjson.put("imagestring",base64String);
                   ^
    1 warning
    the code is:
    <code></p>
  </blockquote>
  
  <pre><code>import java.awt.image.BufferedImage;
  import java.io.ByteArrayInputStream;
  import java.io.ByteArrayOutputStream;
  import java.io.File;
  import java.io.IOException;
  import javax.imageio.ImageIO;
  import org.json.simple.JSONObject;
  import java.io.FileWriter;
  import java.io.FileReader;
  import javax.xml.bind.DatatypeConverter;
  import org.json.simple.parser.JSONParser;
  import org.json.simple.parser.ParseException;
  
  public class Simple 
  {
      public static void main(String[] args) throws IOException
      {
          JSONParser jsonParser=new JSONParser();
          ByteArrayOutputStream baos=new ByteArrayOutputStream(1000);
          BufferedImage img=ImageIO.read(new File("/root/Desktop","Screenshot.png"));
          ImageIO.write(img, "png", baos);
          baos.flush();
          //to store the image as a string
          String base64String=DatatypeConverter.printBase64Binary(baos.toByteArray());
          baos.close();
          System.out.println("string"+base64String);
          JSONObject fjson=new JSONObject();
          fjson.put("imagestring",base64String);
          //the string is written into a json file
          try
          {
              FileWriter writer=new FileWriter("/root/project/code/json/res.json");
              writer.write(fjson.toString());
              writer.close();
          }
          catch(IOException e)
          {
              e.printStackTrace();
          }
          //reading from a json file
          try
          {
              FileReader fr=new FileReader("/root/project/code/json/res.json");
              try
              {
                  JSONObject jParse=(JSONObject)jsonParser.parse(fr);
                  String jsonString=(String)jParse.get("imagestring");
                  byte[] bytearray =DatatypeConverter.parseBase64Binary(jsonString); 
                  BufferedImage imag=ImageIO.read(new ByteArrayInputStream(bytearray));
                  ImageIO.write(imag, "png", new File("/root/project/code/json","snap3.png"));
              }
              catch(ParseException e)
                      {
                              e.printStackTrace();
                      }
          }
          catch(IOException e)
                  {
                          e.printStackTrace();
                  }
      }
  }
  </code></pre>
  
  <p></code></p>