eWON JTK
com.ewon.ewonitf

Class Loader

    • Constructor Summary

      Constructors 
      Constructor and Description
      Loader(String fileName)
      Creates a new instance of Loader
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      void close()
      Flushes this output stream and forces any buffered output bytes to be written out.
      void flush()
      Flushes this output stream and forces any buffered output bytes to be written out.
      void LoadFrom(String fileName)
      Write the file described by the given connector to the Loader Stream.
      This function is typically used after the stream has been created.
      void write(byte[] b, int off, int len)
      Writes len bytes from the specified byte array starting at offset off to this output stream.
      void write(int b)
      Writes the specified byte to this output stream.
    • Method Detail

      • write

        public void write(int b)
                   throws IOException
        Writes the specified byte to this output stream. The 24 high-order bits of b are ignored.

        Specified by:
        write in class OutputStream
        Parameters:
        b - the byte.
        Throws:
        IOException - if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.
      • write

        public void write(byte[] b,
                 int off,
                 int len)
                   throws IOException
        Writes len bytes from the specified byte array starting at offset off to this output stream. This function actually buffers the data to internal writer system that will flush the data when the buffer becomes full.

        If b is null, a NullPointerException is thrown.

        If off is negative, or len is negative, or off+len is greater than the length of the array b, then an IndexOutOfBoundsException is thrown.

        Overrides:
        write in class OutputStream
        Parameters:
        b - the data.
        off - the start offset in the data.
        len - the number of bytes to write.
        Throws:
        IOException - if an I/O error occurs. In particular, an IOException is thrown if the output stream is closed.
      • flush

        public void flush()
                   throws IOException
        Flushes this output stream and forces any buffered output bytes to be written out. The transfert operation is actually executed and may produce an error that would not have been previousely generated during write.

        The flush method of OutputStream does nothing.

        Overrides:
        flush in class OutputStream
        Throws:
        IOException - if an I/O error occurs.
      • close

        public void close()
                   throws IOException
        Flushes this output stream and forces any buffered output bytes to be written out. The transfert operation is actually executed and may produce an error that would not have been previousely generated during write.

        The flush method of OutputStream does nothing.

        Overrides:
        close in class OutputStream
        Throws:
        IOException - if an I/O error occurs.
      • LoadFrom

        public void LoadFrom(String fileName)
                      throws IOException
        Write the file described by the given connector to the Loader Stream.
        This function is typically used after the stream has been created.

        Example:
        Loader loader; //This will load the /usr/MyFile.txt file to the eWON config file. loader = new Loader("/config.txt"); loader.LoadFrom("file:////usr/MyFile.txt"); loader.close();

        Parameters:
        fileName - Name of file to transfert to the Loader output stream (example: file:////usr/MyFile.txt).
        Throws:
        IOException - if an error occurs.
eWON JTK

www.eWON.biz: Your Eyes Watching Over Net