public final class PropertiesBasedStreamMarshaller<T> extends Object implements StreamMarshaller<T>
Constructor and Description |
---|
PropertiesBasedStreamMarshaller(boolean useXml,
PropertiesConverter<T> propsConverter) |
PropertiesBasedStreamMarshaller(PropertiesFormat propertiesFormat,
PropertiesConverter<T> propsConverter) |
Modifier and Type | Method and Description |
---|---|
void |
marshal(T newValue,
OutputStream output)
Marshals the given newValue into a file.
|
T |
unmarshal(InputStream input)
Unmarshals the given file into an instance of T.
|
public PropertiesBasedStreamMarshaller(@Nonnull PropertiesFormat propertiesFormat, @Nonnull PropertiesConverter<T> propsConverter)
public PropertiesBasedStreamMarshaller(boolean useXml, @Nonnull PropertiesConverter<T> propsConverter)
public final void marshal(@Nonnull T newValue, @Nonnull OutputStream output) throws IOException
StreamMarshaller
marshal
in interface StreamMarshaller<T>
newValue
- the value to marshal into the fileoutput
- the destination fileIOException
- if the file does not exist,
is a directory rather than a regular file,
or for some other reason cannot be opened for
reading.public final T unmarshal(@Nonnull InputStream input) throws IOException
StreamMarshaller
unmarshal
in interface StreamMarshaller<T>
input
- the file to unmarshalIOException
- if the file does not exist,
is a directory rather than a regular file,
or for some other reason cannot be opened for
reading.Copyright © 2020. All Rights Reserved.