jhosmer / PySmile

A Python library for encoding/decoding SMILE format data (libsmile)
Apache License 2.0
24 stars 9 forks source link

Continue decoding on binary data #5

Open dpeddi opened 3 years ago

dpeddi commented 3 years ago

When binary data in found on decoding, decoding is interrupted and the JSONin the output buffer is truncated. increasing the index allow the decoding to continue, obviously the binary data isn't decoded yet.

Tested on elasticsearch state file with following code to remove extra header and footer

import json b = open("state-181.st", 'rb').read() x = b[18:-16] d = pysmile.decode(x) print json.dumps(d, indent=4)