public TSLWriter endObject() throws IOException
  {
    if(level == 0 || closed)
    {
      throw new IllegalStateException(ERROR_ROOTCLOSED);      
    }
    if(first_element)
    {
      throw new IllegalStateException("Cannot close an empty TSL Object.");
    }
    level--;
    writeSeparator(false);

    osw.write("]");
    if(level == 0)
    {
      osw.flush();
      closed = true;
    }
    root_element = false;
    first_element = false;
    return this;
  }