Class SMFB2Serializer
- java.lang.Object
-
- com.io7m.smfj.format.binary2.internal.SMFB2Serializer
-
- All Implemented Interfaces:
SMFSerializerType
,java.io.Closeable
,java.lang.AutoCloseable
public final class SMFB2Serializer extends java.lang.Object implements SMFSerializerType
-
-
Constructor Summary
Constructors Constructor Description SMFB2Serializer(SMFFormatVersion inVersion, com.io7m.jbssio.api.BSSWriterSequentialType inWriter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
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.
-
-
-
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 interfaceSMFSerializerType
- Parameters:
header
- The header- Throws:
java.lang.IllegalStateException
- If the header has already been serializedjava.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 interfaceSMFSerializerType
- Returns:
- A serializer for non-interleaved vertex data values
- Throws:
java.lang.IllegalStateException
- If the header has not yet been serializedjava.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 interfaceSMFSerializerType
- Returns:
- A serializer for triangles
- Throws:
java.lang.IllegalStateException
- If the header has not yet been serializedjava.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 interfaceSMFSerializerType
- Parameters:
schema
- The schema IDdata
- The data- Throws:
java.lang.IllegalStateException
- If the header has not yet been serializedjava.io.IOException
- On I/O errors
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-