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 Tcreate(InputStream in)Creates an artifact from the providedInputStream.voidserialize(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
InputStreamremains open.- Parameters:
in- A valid, openInputStreamready 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
OutputStreamremains open.- Parameters:
artifact- A validartifact.out- A valid, openOutputStreamready to write to.- Throws:
IOException- Thrown if IO errors occurred during serialization.
-
-