Class SMFB2Serializer

  • All Implemented Interfaces:
    SMFSerializerType, java.io.Closeable, java.lang.AutoCloseable

    public final class SMFB2Serializer
    extends java.lang.Object
    implements SMFSerializerType
    • Constructor Detail

      • SMFB2Serializer

        public SMFB2Serializer​(SMFFormatVersion inVersion,
                               com.io7m.jbssio.api.BSSWriterSequentialType inWriter)
    • Method Detail

      • serializeHeader

        public void serializeHeader​(SMFHeader header)
                             throws java.lang.IllegalStateException,
                                    java.io.IOException
        Description copied from interface: SMFSerializerType

        Serialize the header data.

        Specified by:
        serializeHeader in interface SMFSerializerType
        Parameters:
        header - The header
        Throws:
        java.lang.IllegalStateException - If the header has already been serialized
        java.io.IOException - On I/O errors
      • serializeVertexDataNonInterleavedStart

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

        public SMFSerializerDataTrianglesType serializeTrianglesStart()
                                                               throws java.lang.IllegalStateException,
                                                                      java.io.IOException
        Description copied from interface: SMFSerializerType

        Start serializing triangles.

        Specified by:
        serializeTrianglesStart in interface SMFSerializerType
        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

        public void serializeMetadata​(SMFSchemaIdentifier schema,
                                      byte[] data)
                               throws java.lang.IllegalStateException,
                                      java.io.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:
        java.lang.IllegalStateException - If the header has not yet been serialized
        java.io.IOException - On I/O errors
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException