Class InputStreamObjectDataReader<T>

    • Constructor Detail

      • InputStreamObjectDataReader

        public InputStreamObjectDataReader​(InputDataSource dataSource,
                                           InputStreamInputConverter<T> converter)
        Construct an instance that will use the specified data source to read data from and convert it to an object with the specified converter. The InputStream of the InputDataSource will be set on the Converter before calling its read method.
        Parameters:
        dataSource - the data source where the data will be read from
        converter - the converter that is used for converting the data into an object
    • Method Detail

      • newGluonObservableObject

        public GluonObservableObject<T> newGluonObservableObject()
        Description copied from interface: ObjectDataReader
        Provide an instance of a GluonObservableObject. This method is called by DataProvider.retrieveObject(ObjectDataReader) to get a GluonObservableObject that will contain the actual object when the retrieve operation has completed successfully. Most implementations will just return an instance of GluonObservableObject itself. Note that it is perfectly valid to return existing instances of GluonObservableObject.
        Specified by:
        newGluonObservableObject in interface ObjectDataReader<T>
        Returns:
        an instance of a GluonObservableObject
      • readObject

        public T readObject()
                     throws IOException
        Reads the object from the specified data source. This implementation uses the specified converter to convert the data that is read from the specified data source into an object. The InputStream of the specified data source will be set on the converter, before calling the read method on the converter.
        Specified by:
        readObject in interface ObjectDataReader<T>
        Returns:
        the read object
        Throws:
        IOException - when an exception occurred during the read process