0

I'd like to know implementation/performance differences between Java SnappyFramedInputStream and SnappyInputStream, as well as best usage scenarios for each one of them. (Same for their OutputStream counterparts).

Thanks in advance!

fps
  • 33,623
  • 8
  • 55
  • 110

1 Answers1

1

The functional difference is that SnappyInputStream is proprietary and SnappyFramedInputStream implements the framing format defined by google (as linked by @andres.santana).

From a performance perspective, I am going to guess that you are talking about the xerial snappy-java implementation (as I believe that is the only SnappyFramedInputStream that currently exists). The difference is that the framing format includes a crc32c checksum on every frame. The SnappyFramedInputStream allows the verification of this checksum to be disabled, which effectively nullifies any difference on a pure reading perspective.

Brett Okken
  • 6,210
  • 1
  • 19
  • 25
  • Thank you very much for your precise and concise response. And yes, I meant the xerial snappy-java implementation. (I'll add the java label to the question). – fps Jun 17 '14 at 13:27
  • 1
    @Magnamag, there is a pure java snappy implementation, but it does not (yet) include support for the framing format. That project also has a proprietary streaming format. It's proprietary format is not compatible with xerial's and is actually more similar to the standard definition in that it includes a checksum on each frame. https://github.com/dain/snappy – Brett Okken Jun 17 '14 at 20:44