Decode consume input as much as it can.