From a30823bfb44c4db75fbd2b35c4c9e7700e1d390e Mon Sep 17 00:00:00 2001 From: Wang Qian <1498953301@qq.com> Date: Mon, 30 Oct 2023 15:38:08 +0800 Subject: [PATCH] fix(adaptive): remove bufSize's limit. --- adaptive/writer.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/adaptive/writer.go b/adaptive/writer.go index 9adfe11..1e789a3 100644 --- a/adaptive/writer.go +++ b/adaptive/writer.go @@ -41,7 +41,7 @@ const ( packageCompressTypeSize = 1 packageDataLenSize = 4 - maxOriginalDataSize = 65536 + // maxOriginalDataSize = 65536 // temoparily is not used, because there is no reusable oBuf in reader. maxCompressedDataSize = 76490 @@ -65,9 +65,9 @@ type Writer struct { } func NewWriter(w io.Writer, bufSize int) *Writer { - if bufSize > maxOriginalDataSize { - panic("lands: the buffer is larger than the maximum of snappy's compression data.") - } + // if bufSize > maxOriginalDataSize { + // panic("lands: the buffer is larger than the maximum of snappy's compression data.") + // } return &Writer{ outW: w, cmpr: snappy.NewCompressor(),