@EngineService(injectDefaultToWorkflow=true, isCoreEngine=true) public class ImageCompressorEngine extends AbstractCompressorEngine
Engine that compress images. Currently do nothing but could be completed in future enhancement.
Constructor and Description |
---|
ImageCompressorEngine(Boolean compress)
Creates a new
Engine . |
Modifier and Type | Method and Description |
---|---|
boolean |
canAggregateTransformedStream()
Indicates if the content generated when
Pipe.Transformer.transform(InputStream, OutputStream, Object) is called can
be aggregated to an other one. |
EngineType |
getEngineType()
Gets the type of engine.
|
List<NutType> |
getNutTypes()
Gets the all
types supported by this engine. |
void |
transform(InputStream source,
OutputStream target,
ConvertibleNut nut)
Reads the stream and writes the transformed bytes.
|
internalParse, works
callNextEngine, chain, getNext, getPrevious, parse, setNext
@ConfigConstructor public ImageCompressorEngine(@BooleanConfigParam(propertyKey="c.g.wuic.engine.compress",defaultValue=true) Boolean compress)
Creates a new Engine
.
compress
- activate compression or notpublic void transform(InputStream source, OutputStream target, ConvertibleNut nut) throws IOException
Reads the stream and writes the transformed bytes.
source
- the inputtarget
- the outputnut
- the object that provides the original input streamIOException
- if an I/O error occurspublic boolean canAggregateTransformedStream()
Indicates if the content generated when Pipe.Transformer.transform(InputStream, OutputStream, Object)
is called can
be aggregated to an other one. This is usually the case but won't be possible for instance when a magic
number should appears only at the beginning of the composite stream and not in each stream of the aggregation.
canAggregateTransformedStream
in interface Pipe.Transformer<ConvertibleNut>
canAggregateTransformedStream
in class AbstractCompressorEngine
true
if aggregation is possible, false
otherwisepublic List<NutType> getNutTypes()
Gets the all types
supported by this engine.
getNutTypes
in class NodeEngine
NutType
public EngineType getEngineType()
Gets the type of engine.
getEngineType
in class Engine
Copyright © 2012-2015. All Rights Reserved.