Replies: 1 comment
-
You can do what you want with WriterCustomEncoder. You can simply return 0 = store uncompressed or -1 = attempt to compress. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'd like to toggle uncompressed-mode between blocks when writing with the s2.Writer.
CPU time is expensive in my environment, and I'm compressing a long stream which contains regions of already S2 compressed data. I'd like to tell the s2.Writer to not even bother compressing those blocks to avoid it spending CPU time on compression and then deciding it wasn't worth it.
Ideally without pipeline stalls when having to call Flush() in between, but that might not be worth the complexity on your side. (Requiring AsyncFlush() would be fine however.)
Alternatively I could use two s2.Writers to the same destination, one with compression and one without.
Beta Was this translation helpful? Give feedback.
All reactions