Mercurial > dive4elements > framework
diff artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultArtifactSerializer.java @ 87:0f48188a6e02
Added some javadoc to the artifactdatabase module. Not done yet.
artifacts/trunk@839 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 26 Mar 2010 11:40:28 +0000 |
parents | 48d1a9a082c2 |
children | e27cf9c84eb8 |
line wrap: on
line diff
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultArtifactSerializer.java Fri Mar 26 10:04:34 2010 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultArtifactSerializer.java Fri Mar 26 11:40:28 2010 +0000 @@ -17,6 +17,10 @@ import org.apache.log4j.Logger; /** + * Default implementation of the ArtifactSerializer interface. + * It uses serialized Java objects which are gzipped and + * turned into bytes. + * * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> */ public class DefaultArtifactSerializer @@ -25,9 +29,15 @@ private static Logger logger = Logger.getLogger(DefaultArtifactSerializer.class); + /** + * Static instance to avoid repeated creation of Serializers. + */ public static final ArtifactSerializer INSTANCE = new DefaultArtifactSerializer(); + /** + * Default constructor. + */ public DefaultArtifactSerializer() { } @@ -83,16 +93,32 @@ } } + /** + * Wraps an input stream into an object input stream. You may + * overwrite this to get a more specialized deserializer. + * @param is The raw input stream + * @return An instance of a subclass of ObjectInputStream. + * @throws IOException Thrown if something went wrong during + * creation of the object input stream. + */ protected ObjectInputStream getObjectInputStream(InputStream is) throws IOException { return new ObjectInputStream(is); } + /** + * Wraps an output stream into an object output stream. You may + * overwrite this to get a more specialized serializer. + * @param os the raw output stream. + * @return An instance of a subclass of ObjectOutputStream. + * @throws IOException Thrown if something went wrong during + * creation of the object output stream. + */ protected ObjectOutputStream getObjectOutputStream(OutputStream os) throws IOException { return new ObjectOutputStream(os); } } -// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :