From 4982e03a20b2c1a1d7e002bcc6ca11d03f9ea320 Mon Sep 17 00:00:00 2001 From: James Bonfield Date: Tue, 7 Jan 2025 14:42:33 +0000 Subject: [PATCH] Clarify the name tokeniser uncomp_len calculation (PR #803) This includes all visible read name bytes plus 1 termination byte per name (e.g. '\0'). Fixes #802 --- CRAMcodecs.tex | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/CRAMcodecs.tex b/CRAMcodecs.tex index e5852a32f..a02a7240b 100644 --- a/CRAMcodecs.tex +++ b/CRAMcodecs.tex @@ -2450,10 +2450,14 @@ \section{Name tokenisation codec} a format within a format, as the multiple byte streams $B_{pos,type}$ are serialised into a single byte stream. -The serialised data stream starts with two unsigned little endiand 32-bit -integers holding the total size of uncompressed name buffer and the -number of read names. This is followed the array elements -themselves. +The serialised data stream starts with two unsigned little endian +32-bit integers holding the total size of uncompressed name buffer and +the number of read names. This is followed the array elements +themselves. Note the uncompressed size is calculated as the sum of +all name lengths including a termination byte per name (e.g. the nul +char). This is irrespective of whether the implementation produces +data in this form or whether it returns separate name and name-length +arrays. Token types, $ttype$ holds one of the token ID values listed above in the list above, plus special values to indicate certain additional