Missing the len of crc32 when calculating maxLen in WriteChunks (#494)

Signed-off-by: naivewong <867245430@qq.com>
This commit is contained in:
naivewong 2019-01-14 23:28:03 +08:00 committed by Goutham Veeramachaneni
parent a360aa3e86
commit bff5aa4d21
1 changed files with 1 additions and 0 deletions

View File

@ -205,6 +205,7 @@ func (w *Writer) WriteChunks(chks ...Meta) error {
for _, c := range chks {
maxLen += binary.MaxVarintLen32 + 1 // The number of bytes in the chunk and its encoding.
maxLen += int64(len(c.Chunk.Bytes()))
maxLen += 4 // The 4 bytes of crc32
}
newsz := w.n + maxLen