Skip to content

Commit 42ec173

Browse files
committed
Add docstring for findTotalContentSize
1 parent 9604b2e commit 42ec173

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

numcodecs/zstd.pyx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,19 @@ cdef stream_decompress(const Py_buffer* source_pb):
360360
return dest
361361

362362
cdef unsigned long long findTotalContentSize(const char* source_ptr, size_t source_size):
363+
"""Find the total uncompressed content size of all frames in the source buffer
364+
365+
Parameters
366+
----------
367+
source_ptr : Pointer to the beginning of the buffer
368+
source_size : Size of the buffer containing the frame sizes to sum
369+
370+
Returns
371+
-------
372+
total_content_size: Sum of the content size of all frames within the source buffer
373+
If any of the frame sizes is unknown, return ZSTD_CONTENTSIZE_UNKNOWN.
374+
If any of the frames causes ZSTD_getFrameContentSize to error, return ZSTD_CONTENTSIZE_ERROR.
375+
"""
363376
cdef:
364377
unsigned long long frame_content_size = 0
365378
unsigned long long total_content_size = 0

0 commit comments

Comments
 (0)