Decode buffer

issue #35