Get Zstandard frame information from a frame header. *frame_buffer* is a bytes-like object. It should start from the beginning of a frame, and needs to include at least the frame header (6 to 18 bytes). The returned FrameInfo object has two attributes. 'decompressed_size' is the si
(frame_buffer)
| 59 | |
| 60 | |
| 61 | def get_frame_info(frame_buffer): |
| 62 | """Get Zstandard frame information from a frame header. |
| 63 | |
| 64 | *frame_buffer* is a bytes-like object. It should start from the beginning |
| 65 | of a frame, and needs to include at least the frame header (6 to 18 bytes). |
| 66 | |
| 67 | The returned FrameInfo object has two attributes. |
| 68 | 'decompressed_size' is the size in bytes of the data in the frame when |
| 69 | decompressed, or None when the decompressed size is unknown. |
| 70 | 'dictionary_id' is an int in the range (0, 2**32). The special value 0 |
| 71 | means that the dictionary ID was not recorded in the frame header, |
| 72 | the frame may or may not need a dictionary to be decoded, |
| 73 | and the ID of such a dictionary is not specified. |
| 74 | """ |
| 75 | return FrameInfo(*_zstd.get_frame_info(frame_buffer)) |
| 76 | |
| 77 | |
| 78 | def train_dict(samples, dict_size): |
searching dependent graphs…