Package de.exlll.configlib
Interface IOStreamConfigurationStore<T>
- Type Parameters:
T- the configuration type
public interface IOStreamConfigurationStore<T>
Instances of this class read and write configurations from input streams and to output streams,
respectively.
The details of how configurations are serialized and deserialized are defined by the implementations of this interface.
-
Method Summary
Modifier and TypeMethodDescriptionread(InputStream inputStream) Reads a configuration from the given input stream.voidwrite(T configuration, OutputStream outputStream) Writes a configuration instance to the given output stream.
-
Method Details
-
write
Writes a configuration instance to the given output stream.- Parameters:
configuration- the configurationoutputStream- the output stream the configuration is written to- Throws:
ConfigurationException- if the configuration contains invalid values or cannot be serializedNullPointerException- if any argument is nullRuntimeException- if writing the configuration throws an exception
-
read
Reads a configuration from the given input stream.- Parameters:
inputStream- the input stream the configuration is read from- Returns:
- a newly created configuration initialized with values read from
inputStream - Throws:
ConfigurationException- if the configuration cannot be deserializedNullPointerException- ifinputStreamis nullRuntimeException- if reading the input stream throws an exception
-