Package org.syncany.chunk
Class GzipTransformer
- java.lang.Object
-
- org.syncany.chunk.Transformer
-
- org.syncany.chunk.GzipTransformer
-
public class GzipTransformer extends Transformer
Implements aTransformerthat transforms the input/output stream using the Gzip compression algorithm.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGzipTransformer.GZIPOutputStreamEx
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringTYPE-
Fields inherited from class org.syncany.chunk.Transformer
nextTransformer
-
-
Constructor Summary
Constructors Constructor Description GzipTransformer()GzipTransformer(int level, Transformer nextTransformer)GzipTransformer(Transformer nextTransformer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.InputStreamcreateInputStream(java.io.InputStream in)Creates a strea-transformingInputStream.java.io.OutputStreamcreateOutputStream(java.io.OutputStream out)Create a stream-transformingOutputStream.voidinit(java.util.Map<java.lang.String,java.lang.String> settings)If a transformer is instantiated via the default constructor (e.g.java.lang.StringtoString()An implementation of a transformer must override this method to identify the type of transformer and/or its settings.-
Methods inherited from class org.syncany.chunk.Transformer
getInstance, setNextTransformer
-
-
-
-
Field Detail
-
TYPE
public static final java.lang.String TYPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GzipTransformer
public GzipTransformer()
-
GzipTransformer
public GzipTransformer(Transformer nextTransformer)
-
GzipTransformer
public GzipTransformer(int level, Transformer nextTransformer)
-
-
Method Detail
-
init
public void init(java.util.Map<java.lang.String,java.lang.String> settings) throws java.lang.Exception
Description copied from class:TransformerIf a transformer is instantiated via the default constructor (e.g. via a config file), it must be initialized using this method. The settings passed to the method depend on the implementation of the transformer.- Specified by:
initin classTransformer- Parameters:
settings- Implementation-specific setting map- Throws:
java.lang.Exception- If the given settings are invalid or insufficient for instantiation
-
createOutputStream
public java.io.OutputStream createOutputStream(java.io.OutputStream out) throws java.io.IOException
Description copied from class:TransformerCreate a stream-transformingOutputStream. Depending on the implementation, the bytes written to the output stream might be encrypted, compressed, etc.- Specified by:
createOutputStreamin classTransformer- Parameters:
out- Original output stream which is transformed by this transformer- Returns:
- Returns a transformed output stream
- Throws:
java.io.IOException- If an exception occurs when instantiating or writing to the stream
-
createInputStream
public java.io.InputStream createInputStream(java.io.InputStream in) throws java.io.IOException
Description copied from class:TransformerCreates a strea-transformingInputStream. Depending on the implementation, the bytes read from the input stream are uncompressed, decrypted, etc.- Specified by:
createInputStreamin classTransformer- Parameters:
in- Original input stream which is transformed by this transformer- Returns:
- Returns a transformed input stream
- Throws:
java.io.IOException- If an exception occurs when instantiating or reading from the stream
-
toString
public java.lang.String toString()
Description copied from class:TransformerAn implementation of a transformer must override this method to identify the type of transformer and/or its settings.- Specified by:
toStringin classTransformer
-
-