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

opennlp.tools.ml.model

## Class GenericModelWriter

- java.lang.Object
- - opennlp.tools.ml.model.AbstractModelWriter
  - - opennlp.tools.ml.model.GenericModelWriter

-     public class GenericModelWriter
      extends AbstractModelWriter

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `GenericModelWriter(AbstractModel model, DataOutputStream dos)`
    `GenericModelWriter(AbstractModel model, File file)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `void` | `persist()`
    `void` | `writeDouble(double d)`
    `void` | `writeInt(int i)`
    `void` | `writeUTF(String s)`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### GenericModelWriter

          public GenericModelWriter(AbstractModel model,
                                    File file)
                             throws IOException

      Throws:
        `IOException`

    - #### GenericModelWriter

          public GenericModelWriter(AbstractModel model,
                                    DataOutputStream dos)

  - ### Method Detail

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in class `AbstractModelWriter`
      Throws:
        `IOException`

    - #### persist

          public void persist()
                       throws IOException

      Specified by:
        `persist` in class `AbstractModelWriter`
      Throws:
        `IOException`

    - #### writeDouble

          public void writeDouble(double d)
                           throws IOException

      Specified by:
        `writeDouble` in class `AbstractModelWriter`
      Throws:
        `IOException`

    - #### writeInt

          public void writeInt(int i)
                        throws IOException

      Specified by:
        `writeInt` in class `AbstractModelWriter`
      Throws:
        `IOException`

    - #### writeUTF

          public void writeUTF(String s)
                        throws IOException

      Specified by:
        `writeUTF` in class `AbstractModelWriter`
      Throws:
        `IOException`

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