Skip to content
This repository has been archived by the owner on Apr 2, 2020. It is now read-only.

encode with io.Writer / decode with io.Reader #14

Open
lachie opened this issue May 7, 2014 · 14 comments
Open

encode with io.Writer / decode with io.Reader #14

lachie opened this issue May 7, 2014 · 14 comments

Comments

@lachie
Copy link

lachie commented May 7, 2014

I'd love to use this code, but my project involves compressing files up to gigabytes in size.

For that use case I really need a streaming version of the algorithm (i.e. using the io.Writer/io.Reader interfaces). I see there's one as part of the reference C implementation, but I really have no idea where to start with porting it to Go.

@dgryski
Copy link
Collaborator

dgryski commented May 7, 2014

The io.Reader/io.Writer interface was removed in 5298eaf due to bugs and slowness.

I agree having a streaming interface would be useful. IIRC, the old C library faked streaming by buffering in (~65k?) blocks and compressing in batches. You could do something similar and construct your own framing, assuming you don't need compatibility with any other implementation.

I see there is now a more complete spec for an LZ4 streaming format: https://docs.google.com/document/d/1gZbUoLw5hRzJ5Q71oPRN6TO4cRMTZur60qip-TE7BhQ/edit . We should probably support this format.

@dgryski
Copy link
Collaborator

dgryski commented May 7, 2014

Looks like the streaming format isn't completely implementing in the C lz4 implementation: https://code.google.com/p/lz4/issues/detail?id=42

@lachie
Copy link
Author

lachie commented May 8, 2014

ok no worries, that sounds like a good solution

@lachie lachie closed this as completed May 8, 2014
@dgryski dgryski reopened this May 8, 2014
@dgryski
Copy link
Collaborator

dgryski commented May 8, 2014

Leaving this open as a reminder to put back the streaming support.

@dgryski
Copy link
Collaborator

dgryski commented May 20, 2014

@vtolstov
Copy link

Any progress about steaming support ?

@dgryski
Copy link
Collaborator

dgryski commented Jul 14, 2014

Spec has been finalised. I'll add it nearer the top of my todo list.

@vtolstov
Copy link

@dgryski hello, do you have any news about streaming support?

@vtolstov
Copy link

ping...

@dgryski
Copy link
Collaborator

dgryski commented Jan 20, 2015

I'm unlikely to get to this anytime soon. I will glady review any merge any pull requests for this feature.

Sorry :(

@vtolstov
Copy link

2015-01-20 13:39 GMT+03:00 Damian Gryski notifications@github.com:

I'm unlikely to get to this anytime soon. I will glady review any merge
any pull requests for this feature.

Sorry :(

Ok. May be i'm try.

Vasiliy Tolstov,
e-mail: v.tolstov@selfip.ru
jabber: vase@selfip.ru

@xxorde
Copy link

xxorde commented Sep 24, 2016

ping...

Any progress so far?

Or does anyone has good working example for using blocks and compressing in batches?

@dgryski
Copy link
Collaborator

dgryski commented Sep 24, 2016

Some of the other Go lz4 ports have implemented the streaming interface: https://github.com/pierrec/lz4 for example

@xxorde
Copy link

xxorde commented Sep 25, 2016

Thank you for this hint. It was way harder to implement this myself than I thought.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants