com.io7m.smfj.format.binary.v1

## Class SMFBv1Serializer

- java.lang.Object
- - com.io7m.smfj.format.binary.v1.SMFBv1Serializer

- All Implemented Interfaces:
    SMFSerializerType, Closeable, AutoCloseable

      public final class SMFBv1Serializer
      extends Object
      implements SMFSerializerType

  A serializer for the 1.* format.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SMFBv1Serializer(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

    - #### SMFBv1Serializer

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

      Construct a serializer.
      Parameters:
        `in_version` - The output format version
        `in_uri` - The URI for diagnostics
        `in_stream` - The output stream

  - ### Method Detail

    - #### serializeHeader

          public void serializeHeader(SMFHeader in_header)
                               throws IllegalStateException,
                                      IOException

      Description copied from interface: `SMFSerializerType`

      Serialize the header data.

      Specified by:
        `serializeHeader` in interface `SMFSerializerType`
      Parameters:
        `in_header` - The header
      Throws:
        `IllegalStateException` - If the header has already been serialized
        `IOException` - On I/O errors

    - #### serializeVertexDataNonInterleavedStart

          public SMFSerializerDataAttributesNonInterleavedType serializeVertexDataNonInterleavedStart()
                                                                                               throws IllegalStateException,
                                                                                                      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:
        `IllegalStateException` - If the header has not yet been serialized
        `IOException` - On I/O errors

    - #### serializeTrianglesStart

          public SMFSerializerDataTrianglesType serializeTrianglesStart()
                                                                 throws IllegalStateException,
                                                                        IOException

      Description copied from interface: `SMFSerializerType`

      Start serializing triangles.

      Specified by:
        `serializeTrianglesStart` in interface `SMFSerializerType`
      Returns:
        A serializer for triangles
      Throws:
        `IllegalStateException` - If the header has not yet been serialized
        `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