TMX import and TMX export is performed in multiple chunks because TMX files can be of very large size. Sending/receiving of a TMX document as one web service call would require the entire document to be kept in memory by most web service platforms. To perform TMX import the required steps are the following:
- Start a new TMX import session by calling BeginChunkedTMXImport.
- Import the chunks of a TMX document by calling AddNextTMXChunk in turns.
- Call EndChunkedTMXImport at the end to close the TMX import session.
It is crucial that the chunk boundaries are on whole characters. It should never happen that the end of a chunk contains the beginning of a unicode character and the beginning of the next chunk contains the remaining part! This can be easily implemented in .NET by using StreamReader to process the TMX file on the client.
The steps of TMX export are very similar:
- Start a new TMX export session by calling BeginChunkedTMXExport.
- Import the chunks of a TMX document by calling GetNextTMXChunk in turns.
- Call EndChunkedTMXExport at the end to close the TMX import session.