Class LocalOptimizationUtil.BusinessObjectJsonOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.PipedOutputStream
-
- com.gc.iotools.stream.os.OutputStreamToInputStream<ValueServiceResponse<TransferObject>>
-
- org.technologybrewery.fermenter.stout.client.service.LocalOptimizationUtil.BusinessObjectJsonOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
- Enclosing class:
- LocalOptimizationUtil
public class LocalOptimizationUtil.BusinessObjectJsonOutputStream extends com.gc.iotools.stream.os.OutputStreamToInputStream<ValueServiceResponse<TransferObject>>
Converts an OutputStream into an InputStream via an underlying Pipes implementation to prevent loading the entire object into memory for a ValueServiceResponse-> ValueServiceResponse transformation. See EasyStream documentation for more (somewhat confusing) information (but better than doing it all by hand). Bottom line - this takes an InputStream of JSON representing a specific ValueServiceResponse with BusinessObject(s) and streams that into a specific ValueServiceResponse with TransferObject(s). Super obvious, right?
-
-
Constructor Summary
Constructors Constructor Description BusinessObjectJsonOutputStream(com.fasterxml.jackson.databind.ObjectMapper objectMapper, Class<?> transferObjectClass)New instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ValueServiceResponse<TransferObject>doRead(InputStream istream)-
Methods inherited from class com.gc.iotools.stream.os.OutputStreamToInputStream
afterClose, close, close, flush, getResult, setDefaultPipeSize, write, write, write
-
Methods inherited from class java.io.PipedOutputStream
connect
-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Constructor Detail
-
BusinessObjectJsonOutputStream
public BusinessObjectJsonOutputStream(com.fasterxml.jackson.databind.ObjectMapper objectMapper, Class<?> transferObjectClass)New instance.- Parameters:
objectMapper- ObjectMapper to perform the transformationtransferObjectClass- the specific TransferObject class being transformed
-
-
Method Detail
-
doRead
protected ValueServiceResponse<TransferObject> doRead(InputStream istream) throws Exception
- Specified by:
doReadin classcom.gc.iotools.stream.os.OutputStreamToInputStream<ValueServiceResponse<TransferObject>>- Throws:
Exception
-
-