Package com.io7m.smfj.serializer.api

## Interface SMFSerializerType

- All Superinterfaces:
    `java.lang.AutoCloseable`, `java.io.Closeable`
  All Known Implementing Classes:
    `SMFB2Serializer`, `SMFTV1Serializer`, `SMFXSerializer`

      public interface SMFSerializerType
      extends java.io.Closeable

  The type of serializers.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `serializeHeader​(SMFHeader header)` | Serialize the header data.
    `void` | `serializeMetadata​(SMFSchemaIdentifier schema, byte[] data)` | Serialize one item of metadata.
    `SMFSerializerDataTrianglesType` | `serializeTrianglesStart()` | Start serializing triangles.
    `SMFSerializerDataAttributesNonInterleavedType` | `serializeVertexDataNonInterleavedStart()` | Start serializing non-interleaved vertex data.

    - ### Methods inherited from interface java.io.Closeable

      `close`

- - ### Method Detail

    - #### serializeHeader

          void serializeHeader​(SMFHeader header)
                        throws java.lang.IllegalStateException,
                               java.io.IOException

      Serialize the header data.

      Parameters:
        `header` - The header
      Throws:
        `java.io.IOException` - On I/O errors
        `java.lang.IllegalStateException` - If the header has already been serialized

    - #### serializeVertexDataNonInterleavedStart

          SMFSerializerDataAttributesNonInterleavedType serializeVertexDataNonInterleavedStart()
                                                                                        throws java.lang.IllegalStateException,
                                                                                               java.io.IOException

      Start serializing non-interleaved vertex data.

      If the method raises an exception, the serializer is considered to have failed and all subsequent method calls will raise `IllegalArgumentException`.

      Returns:
        A serializer for non-interleaved vertex data values
      Throws:
        `java.lang.IllegalStateException` - If the header has not yet been serialized
        `java.io.IOException` - On I/O errors

    - #### serializeTrianglesStart

          SMFSerializerDataTrianglesType serializeTrianglesStart()
                                                          throws java.lang.IllegalStateException,
                                                                 java.io.IOException

      Start serializing triangles.

      Returns:
        A serializer for triangles
      Throws:
        `java.lang.IllegalStateException` - If the header has not yet been serialized
        `java.io.IOException` - On I/O errors

    - #### serializeMetadata

          void serializeMetadata​(SMFSchemaIdentifier schema,
                                 byte[] data)
                          throws java.lang.IllegalStateException,
                                 java.io.IOException

      Serialize one item of metadata.

      Parameters:
        `schema` - The schema ID
        `data` - The data
      Throws:
        `java.lang.IllegalStateException` - If the header has not yet been serialized
        `java.io.IOException` - On I/O errors