Mikal,
That's a much better idea, returning a boolean from the encode method is an excellent solution.