ArtifactSerializer (Apache OpenNLP Tools 2.5.9 API)
Description: declaration: package: opennlp.tools.util.model, interface: ArtifactSerializer

# 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 Type
  Method
  Description
  `T`
  `create(InputStream in)`
  Creates an artifact from the provided `InputStream`.
  `void`
  `serialize(T artifact, OutputStream out)`
  Serializes an artifact to the provided `OutputStream`.

- ## Method Details

  - ### create

    T create(InputStream in) throws IOException
    Creates an artifact from the provided `InputStream`.

    Note: The `InputStream` remains open.

    Parameters:
      `in` - A valid, open `InputStream` 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 provided `OutputStream`.

    Note: The `OutputStream` remains open.

    Parameters:
      `artifact` - A valid `artifact`.
      `out` - A valid, open `OutputStream` ready to write to.
    Throws:
      `IOException` - Thrown if IO errors occurred during serialization.