Code example for RuntimeException

0
   //Serialization 
   public void save(ObjectOutputStream objstream) throws IOException 
   { 
      objstream.writeObject(this);
      if (m_VDPImage == null)
         throw new RuntimeException("The Image Object is Null");
       
      m_FileFormat = m_ImageFileName.substring(m_ImageFileName.indexOf(".")+1, 
                                               m_ImageFileName.length());
      ImageIO.write(m_VDPImage, m_FileFormat, objstream);
   } 
    
   //De-Serialization 
   public static Object load(ObjectInputStream objstream) throws Exception 
   { 
      SaveImageRequest saveImgReq = (SaveImageRequest) objstream.readObject();
      saveImgReq.m_VDPImage = ImageIO.read(objstream); 
      return saveImgReq;
   } 
    
   public String toString()