T - the type of the object to writepublic class OutputStreamObjectDataWriter<T> extends java.lang.Object implements ObjectDataWriter<T>
ObjectDataWriter that writes an object by converting it with a specific
OutputStreamOutputConverter and writing it to a specific
OutputDataSource.| Constructor and Description |
|---|
OutputStreamObjectDataWriter(OutputDataSource dataSource,
OutputStreamOutputConverter<T> converter)
Construct an instance that will use the specified data source to write the object to that is converted with the
specified converter.
|
| Modifier and Type | Method and Description |
|---|---|
GluonObservableObject<T> |
newGluonObservableObject()
Provide an instance of a GluonObservableObject.
|
java.util.Optional<T> |
writeObject(T object)
Writes the object to the specified data source and returns an Optional that contains the exact same object
instance that was passed in.
|
public OutputStreamObjectDataWriter(OutputDataSource dataSource, OutputStreamOutputConverter<T> converter)
write method.dataSource - the data source where the converted object will be written toconverter - the converter that is used for converting the object to be writtenpublic GluonObservableObject<T> newGluonObservableObject()
ObjectDataWriterDataProvider.storeObject(Object, ObjectDataWriter)
to get a GluonObservableObject that will contain the actual object when the store 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.newGluonObservableObject in interface ObjectDataWriter<T>public java.util.Optional<T> writeObject(T object) throws java.io.IOException
object. The OutputStream of the specified data source will be set on the converter, before calling
the write method on the converter.writeObject in interface ObjectDataWriter<T>object - the object to writejava.io.IOException - when an exception occurred during the write process