Skip to content

Commit

Permalink
feat: Make input and ooutput sizes of the stream buffers public
Browse files Browse the repository at this point in the history
They can be used to create optimal size buffers for reading file content.
  • Loading branch information
prantlf committed Oct 26, 2023
1 parent f9e5872 commit b34cd33
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ cctx.compress_end(mut sctx)!
#### Compression

```v
const (
compress_stream_out_size
compress_stream_in_size
)
new_compress_stream_context() &StreamContext
(c &CompressContext) compress_chunk(
mut sctx StreamContext, src []u8, last bool, drain fn (buf &u8, len int) !) !
Expand All @@ -211,6 +216,11 @@ new_compress_stream_context() &StreamContext
#### Decompression

```v
const (
decompress_stream_out_size
decompress_stream_in_size
)
new_decompress_stream_context() &StreamContext
(d &DecompressContext) decompress_chunk(
mut sctx StreamContext, src []u8, last bool, drain fn (buf &u8, len int) !) !
Expand Down
2 changes: 1 addition & 1 deletion src/compress_stream.v
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module zstd

const (
pub const (
compress_stream_out_size = int(C.ZSTD_CStreamOutSize())
compress_stream_in_size = int(C.ZSTD_CStreamInSize())
)
Expand Down
2 changes: 1 addition & 1 deletion src/decompress_stream.v
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module zstd

const (
pub const (
decompress_stream_out_size = int(C.ZSTD_DStreamOutSize())
decompress_stream_in_size = int(C.ZSTD_DStreamInSize())
)
Expand Down

0 comments on commit b34cd33

Please sign in to comment.