Package opennlp.tools.util.model
Interface ArtifactSerializer<T>
- All Known Implementing Classes:
AncoraSpanishHeadRules.HeadRulesSerializer
,BrownCluster.BrownClusterSerializer
,ByteArraySerializer
,ChunkerModelSerializer
,DictionarySerializer
,GenericModelSerializer
,HeadRules.HeadRulesSerializer
,POSModelSerializer
,POSTaggerFactory.POSDictionarySerializer
,WordClusterDictionary.WordClusterDictionarySerializer
public interface ArtifactSerializer<T>
Responsible to create an artifact from an
InputStream
.-
Method Summary
Modifier and TypeMethodDescriptioncreate
(InputStream in) Creates an artifact from the providedInputStream
.void
serialize
(T artifact, OutputStream out) Serializes an artifact to the providedOutputStream
.
-
Method Details
-
create
Creates an artifact from the providedInputStream
.Note: The
InputStream
remains open.- Parameters:
in
- A valid, openInputStream
ready to read from.- Returns:
- A valid
artifact
. - Throws:
IOException
- Thrown if IO errors occurred during creation.
-
serialize
Serializes an artifact to the providedOutputStream
.Note: The
OutputStream
remains open.- Parameters:
artifact
- A validartifact
.out
- A valid, openOutputStream
ready to write to.- Throws:
IOException
- Thrown if IO errors occurred during serialization.
-