public class BufferEncoder extends java.lang.Object implements MesgListener, MesgDefinitionListener
| Constructor and Description |
|---|
BufferEncoder()
Deprecated.
Encoder now supports encoding files of differing protocol
versions, use
BufferEncoder(Fit.ProtocolVersion) to ensure
the encoder is validating your files correctly |
BufferEncoder(Fit.ProtocolVersion version)
Constructs a new File Encoder for specified file.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
close()
Updates the data size in the file header, writes the CRC, and returns the buffer.
|
void |
onMesg(Mesg mesg)
MesgListener interface.
|
void |
onMesgDefinition(MesgDefinition mesgDefinition)
MesgDefinitionListener interface.
|
void |
open()
Resets the output stream and writes the file header.
|
void |
write(java.util.List<? extends Mesg> mesgs)
Writes a list of messages to the file.
|
void |
write(Mesg mesg)
Writes a message to the buffer.
|
void |
write(MesgDefinition mesgDefinition)
Writes a message definition to the buffer.
|
@Deprecated public BufferEncoder()
BufferEncoder(Fit.ProtocolVersion) to ensure
the encoder is validating your files correctlypublic BufferEncoder(Fit.ProtocolVersion version)
version - Fit Protocol Version to use when writing filespublic void open()
public void onMesg(Mesg mesg)
onMesg in interface MesgListenerpublic void onMesgDefinition(MesgDefinition mesgDefinition)
onMesgDefinition in interface MesgDefinitionListenerpublic void write(MesgDefinition mesgDefinition)
mesgDefinition - message definition object to writepublic void write(Mesg mesg)
mesg - message object to writepublic void write(java.util.List<? extends Mesg> mesgs)
mesgs - list message objects to writepublic byte[] close()