ArtifactSerializer (Apache OpenNLP Tools 1.9.5 API)
Date: 2026-06-18

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

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `create(InputStream in)` Creates the artifact from the provided `InputStream`.
    `void` | `serialize(T artifact, OutputStream out)` Serializes the artifact to the provided `OutputStream`.

- - ### Method Detail

    - #### create

          T create(InputStream in)
            throws IOException

      Creates the artifact from the provided `InputStream`. The `InputStream` remains open.
      Returns:
        the artifact
      Throws:
        `IOException`

    - #### serialize

          void serialize(T artifact,
                         OutputStream out)
                  throws IOException

      Serializes the artifact to the provided `OutputStream`. The `OutputStream` remains open.
      Parameters:
        `artifact` -
        `out` -
      Throws:
        `IOException`

Copyright © 2026 The Apache Software Foundation. All rights reserved.