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 anInputStream
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
create(InputStream in)
Creates the artifact from the providedInputStream
.void
serialize(T artifact, OutputStream out)
Serializes the artifact to the providedOutputStream
.
-
-
-
Method Detail
-
create
T create(InputStream in) throws IOException
Creates the artifact from the providedInputStream
. TheInputStream
remains open.- Returns:
- the artifact
- Throws:
IOException
-
serialize
void serialize(T artifact, OutputStream out) throws IOException
Serializes the artifact to the providedOutputStream
. TheOutputStream
remains open.- Parameters:
artifact
-out
-- Throws:
IOException
-
-