duchien85 / kryo

Automatically exported from code.google.com/p/kryo
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Compressor isn't able to compress more then 36k of data #51

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The problem is in com\esotericsoftware\kryo\Compressor.java 
line 78
    buffer.putShort((short)(outputBuffer.limit()));
line 91
    int length = buffer.getShort();

I can see 2 solutions for the problem:
    1. Throw exception if outputBuffer.limit() > (int)Short.MAX_VALUE
    2. buffer.putInt(outputBuffer.limit());int length = buffer.getInt();

Current situation is very confusing, because no exception generated and reading 
of object does not work properly.

Kryo 1.04  

Thanks in advance for great serialization library.

Steve Romankov stepan(at)romankov.name

Original issue reported on code.google.com by ste...@romankov.name on 17 Feb 2012 at 11:35

GoogleCodeExporter commented 9 years ago

Original comment by nathan.s...@gmail.com on 17 Apr 2012 at 10:25