Interface ModelDeserializer<M>

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default M readModel​(byte[] buf)
      Reads the contents from the given byte buffer and de-serializes it into a model instance.
      default M readModel​(File f)
      Reads the contents from the given file and de-serializes it into a model instance.
      M readModel​(InputStream is)
      Reads the contents from the given input stream and de-serializes it into a model instance.
      default M readModel​(URL url)
      Reads the contents from the given URL and de-serializes it into a model instance.
    • Method Detail

      • readModel

        M readModel​(InputStream is)
             throws IOException
        Reads the contents from the given input stream and de-serializes it into a model instance.

        Note: the input stream will not be closed.

        Parameters:
        is - the input stream to read data from
        Returns:
        the de-serialized model
        Throws:
        IOException - if an error occurred while reading from the stream
        FormatException - if the content of the stream was not in the expected format
      • readModel

        default M readModel​(URL url)
                     throws IOException
        Reads the contents from the given URL and de-serializes it into a model instance.
        Parameters:
        url - the url to read data from
        Returns:
        the de-serialized model
        Throws:
        IOException - if an error occurred while reading from the stream
        FormatException - if the content of the stream was not in the expected format
      • readModel

        default M readModel​(File f)
                     throws IOException
        Reads the contents from the given file and de-serializes it into a model instance.
        Parameters:
        f - the file to read data from
        Returns:
        the de-serialized model
        Throws:
        IOException - if an error occurred while reading from the stream
        FormatException - if the content of the stream was not in the expected format
      • readModel

        default M readModel​(byte[] buf)
                     throws IOException
        Reads the contents from the given byte buffer and de-serializes it into a model instance.
        Parameters:
        buf - the buffer to read data from
        Returns:
        the de-serialized model
        Throws:
        IOException - if an error occurred while reading from the stream
        FormatException - if the content of the stream was not in the expected format