wspringer/preon — Issue #8: NullTerminatedStringCodec.decode not robust
Author: olerass
Created: 2012-02-26 20:34:23+00:00
State: open

Hi. First of all thanks for putting such a great project into the world! I stumbled upon it a few days ago. I need to write an application that's almost exclusively dependent on reading binary datastructures so don't be surprised if this isn't going to be my last ticket ;)

Anyway is there a (good) reason why the ByteBuffer size (BUFFER_SIZE) is hardcoded to 32 bytes in NullTerminatedStringCodec? A null terminated string can have any length. In my case I need to read strings of length up to 256. Increasing the BUFFER_SIZE doesn't solve the problem. The implementation probably needs to be changed to allow for any string lengths.

I'd usually give some suggestions as to what could be done, but I have only spent five minutes in the code so excuse me for not being constructive:)

Regards,
Ole