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 an artifact from the providedInputStream
.void
serialize(T artifact, OutputStream out)
Serializes an artifact to the providedOutputStream
.
-
-
-
Method Detail
-
create
T create(InputStream in) throws IOException
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
void serialize(T artifact, OutputStream out) throws IOException
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.
-
-