code: public ArrayList parse(ArrayList ls) throws IOException {
          if (ls == null)
              ls = new ArrayList();
          else
              ls.clear();
          PdfObject ob = null;
          while ((ob = readPRObject()) != null) {
              ls.add(ob);
              if (ob.type() == COMMAND_TYPE)
                  break;
          }
          return ls;
      }
docs: Parses a single command from the content. Each command is output as an array of arguments
  having the command itself as the last element. The returned array will be empty if the
  end of content was reached.
  @param ls an <CODE>ArrayList</CODE> to use. It will be cleared before using. If it's
  <CODE>null</CODE> will create a new <CODE>ArrayList</CODE>
  @return the same <CODE>ArrayList</CODE> given as argument or a new one
  @throws IOException on error