     p_path in varchar2,
     p_filename in varchar2)
   as
-   l_tmp_lob blob;
-  begin
-    --
+    l_tmp_lob blob;
+  begin
+
     -- exit if any parameter is null
-    --
-    if    p_text     is null
-       or p_path     is null
-       or p_filename is null
-    then
-      return;
-    end if;
-
-    --
+    oos_util.assert(p_text is not null, 'p_text required parameter');
+    oos_util.assert(p_path is not null, 'p_path required parameter');
+    oos_util.assert(p_filename is not null, 'p_filename required parameter');
+
     -- convert a clob to a blob
-    --
     l_tmp_lob := clob2blob(p_text);
 
-    --
     -- write a blob to a file
-    --
     declare
       l_lob_len pls_integer;
       l_fh utl_file.file_type;

    l_fh utl_file.file_type;
    l_tmp_lob clob;
  begin
    l_fh := utl_file.fopen(location     => p_path,
                           filename     => p_filename,
                           open_mode    => 'r',
                           max_linesize => 32767);

    dbms_lob.createtemporary(lob_loc => l_tmp_lob,
                             cache   => false,
                             dur     => dbms_lob.session);

    declare
      l_lt constant varchar2(1) := chr(10); -- unix line terminator
      l_buf varchar2(32767);
    begin
      loop
        utl_file.get_line(l_fh, l_buf);
        dbms_lob.writeappend(l_tmp_lob, length(l_buf), l_buf);
        -- get_line ignores line terminator so it is explicitly included
        dbms_lob.writeappend(l_tmp_lob, length(l_lt), l_lt);
      end loop;
    exception
      when no_data_found then

    utl_file.fclose(l_fh);

    return l_tmp_lob;
  end read_from_file;

end oos_util_lob;
/
