Skip to content

Write stream identifier chunk even for empty input #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions snappy.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,9 @@ def stream_compress(src, dst, blocksize=_STREAM_TO_STREAM_BLOCK_SIZE):
"""
compressor = StreamCompressor()
while True:
buf = src.read(blocksize)
buf = compressor.add_chunk(src.read(blocksize))
if not buf: break
buf = compressor.add_chunk(buf)
if buf: dst.write(buf)
dst.write(buf)


def stream_decompress(src, dst, blocksize=_STREAM_TO_STREAM_BLOCK_SIZE):
Expand Down