title: How do I convert a string to an iCalendar(ics) object?
body: <p>I have been given the task of implementing a way to convert a string received through a JSON object to an iCalendar object(ics). I found the iCal4j library and have been attempting to use that as my parser. however it seems that the CalendarBuilder takes an InputStream.</p>
  
  <p>How do I proceed ? </p>
  
  <pre><code>String response = jsonObj.getString("icalendar");
  
  CalendarBuilder calBuiler = new CalendarBuilder();
  Calendar calendar = calBuilder.build("???");
  ....
  </code></pre>
  
  <p>Edit : Would this work? </p>
  
  <pre><code>public Calendar convertStringtoCalendar(String arg)
  {
      CalendarBuilder calBuiler = new CalendarBuilder();
      InputStream is;
      try {
          is = new ByteArrayInputStream(arg.getBytes("UTF-8"));
          return calBuiler.build(is);
  
      } catch (UnsupportedEncodingException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      } catch (ParserException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  
      return null;
  }
  </code></pre>