Add a rac.CodecWriter.CanCut method

This commit is contained in:
Nigel Tao committed 2019-09-01 15:37:21 +10:00
1 parent 0a31851d85
commit 1fa39758cf
3 files changed
+14

No files matched your search

+5
View File
@@ -264,6 +264,11 @@ func (w *CodecWriter) compress(p []byte, q []byte, dict []byte) ([]byte, error)
return w.compressed.Bytes(), nil
}
// CanCut implements rac.CodecWriter.
func (w *CodecWriter) CanCut() bool {
return true
}
// Cut implements rac.CodecWriter.
func (w *CodecWriter) Cut(codec rac.Codec, encoded []byte, maxEncodedLen int) (encodedLen int, decodedLen int, retErr error) {
if codec != rac.CodecZlib {