Patch a bug in the genbank reader for the sequence longer than 10kb.

This commit is contained in:
2023-02-17 10:54:03 +01:00
parent ed87f821eb
commit 8458c0cd8b
2 changed files with 41 additions and 34 deletions

View File

@@ -209,25 +209,28 @@ func _ReadFlatFileChunk(reader io.Reader, readers chan _FileChunk) {
end = _EndOfLastEntry(buff)
// If an extension was read, log the size and number of extensions
log.Debugf("Flat File chunck : final buff size %d bytes (%d extensions) -> end = %d\n",
len(buff),
ic,
end,
)
if len(buff) > 0 {
remains := buff[end:]
buff = buff[:end]
// Send the chunk of data as a _FileChunk struct to the readers channel
io := bytes.NewBuffer(buff)
log.Debugf("Flat File chunck : final buff size %d bytes (%d) (%d extensions) -> end = %d\n",
len(buff),
io.Cap(),
ic,
end,
)
readers <- _FileChunk{io, i}
i++
// Set the buffer to the size of a chunk of data and copy any remaining data to the new buffer
buff = make([]byte, _FileChunkSize)
copy(buff, remains)
l = len(remains)
l = len(remains)
}
}