Interface NativeJavaResourceOut

    • Method Detail

      • getOutputStream

        OutputStream getOutputStream()
                              throws IOException
        Opens a stream to write data to. For parameters this writes to the "Out" value of a parameter and will be become a distinct JobFile afterwards. The caller is responsible for closing this stream. The file by default will be called 'parametername.dat' for parameters of type File, and 'parametername.rtx' for parameters of type Table. If you want to use a different file extension use getOutputStream(String) instead. Additionally if you want to append, instead of overwriting the file (which is the default behavior when called multiple times), you can use getOutputStream(WriteMode) or both options combined use getOutputStream(WriteMode, String).
        Returns:
        OutputStream to write to.
        Throws:
        IOException - When the stream cannot be opened
      • getOutputStream

        OutputStream getOutputStream​(WriteMode writeMode)
                              throws IOException
        Similar to getOutputStream() except that it allows you to specify the WriteMode. Note that the first time this method is called a file does not exist yet, but if called multiple times the WriteMode.Append will append to that file rather that overwriting it.
        Parameters:
        writeMode - Whether to overwrite an existing file or append to it instead.
        Returns:
        OutputStream to write to.
        Throws:
        IOException - When the stream cannot be opened
      • getOutputStream

        OutputStream getOutputStream​(String fileExtension)
                              throws IOException
        Opens a stream to write data to. For parameters this writes to the "Out" value of a parameter and will be become a distinct JobFile afterwards. The caller is responsible for closing this stream. The name of the file will be parametername + fileExtension. For example with a parameter called 'data' and file extension '.txt' the file will be written as 'data.txt'. Using this method multiple times will always write to 1 file and overwrite it, even when different extensions are used - the last extension is used in that case.
        Parameters:
        fileExtension - File extension to use, e.g. .txt
        Returns:
        OutputStream to write to.
        Throws:
        IOException - When the stream cannot be opened
      • getOutputStream

        OutputStream getOutputStream​(WriteMode writeMode,
                                     String fileExtension)
                              throws IOException
        Similar to getOutputStream(String) except that it allows you to specify the WriteMode.
        Parameters:
        writeMode - Whether to overwrite an existing file or append to it instead.
        fileExtension - File extension to use, e.g. .txt
        Returns:
        OutputStream to write to.
        Throws:
        IOException - When the stream cannot be opened