Looking the implementation, it seems to allow onWriteOutput to return true/false which affects whether the buffer is written.  I simply suggest to follow that same design as opposed to invent another way - null encoding.