all emit methods now return number of bytes that were emitted.