com.io7m.smfj.format.text.v1

## Class SMFTV1Serializer

- java.lang.Object
- - com.io7m.smfj.format.text.v1.SMFTV1Serializer

- All Implemented Interfaces:
    SMFSerializerType, Closeable, AutoCloseable

      public final class SMFTV1Serializer
      extends Object
      implements SMFSerializerType

  A serializer.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SMFTV1Serializer(SMFFormatVersion in_version, URI in_uri, OutputStream in_stream)` Construct a serializer.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `void` | `serializeHeader(SMFHeader in_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 class java.lang.Object

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

- - ### Constructor Detail

    - #### SMFTV1Serializer

          public SMFTV1Serializer(SMFFormatVersion in_version,
                                  URI in_uri,
                                  OutputStream in_stream)

      Construct a serializer.
      Parameters:
        `in_version` - The format version
        `in_uri` - The URI of the target, for diagnostic purposes
        `in_stream` - An output stream

  - ### Method Detail

    - #### serializeHeader

          public void serializeHeader(SMFHeader in_header)
                               throws IOException

      Description copied from interface: `SMFSerializerType`

      Serialize the header data.

      Specified by:
        `serializeHeader` in interface `SMFSerializerType`
      Parameters:
        `in_header` - The header
      Throws:
        `IOException` - On I/O errors

    - #### serializeVertexDataNonInterleavedStart

          public SMFSerializerDataAttributesNonInterleavedType serializeVertexDataNonInterleavedStart()
                                                                                               throws IOException

      Description copied from interface: `SMFSerializerType`

      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`.

      Specified by:
        `serializeVertexDataNonInterleavedStart` in interface `SMFSerializerType`
      Returns:
        A serializer for non-interleaved vertex data values
      Throws:
        `IOException` - On I/O errors

    - #### serializeTrianglesStart

          public SMFSerializerDataTrianglesType serializeTrianglesStart()
                                                                 throws IOException

      Description copied from interface: `SMFSerializerType`

      Start serializing triangles.

      Specified by:
        `serializeTrianglesStart` in interface `SMFSerializerType`
      Returns:
        A serializer for triangles
      Throws:
        `IOException` - On I/O errors

    - #### serializeMetadata

          public void serializeMetadata(SMFSchemaIdentifier schema,
                                        byte[] data)
                                 throws IllegalStateException,
                                        IOException

      Description copied from interface: `SMFSerializerType`

      Serialize one item of metadata.

      Specified by:
        `serializeMetadata` in interface `SMFSerializerType`
      Parameters:
        `schema` - The schema ID
        `data` - The data
      Throws:
        `IllegalStateException` - If the header has not yet been serialized
        `IOException` - On I/O errors

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Throws:
        `IOException`

Copyright © 2017 <code@io7m.com> http://io7m.com