class BinData::IO::Write

def transform(io)

yields +self+ and +io+ to the given block

+io+ must be an instance of +Transform+.

See +BinData::Buffer+ as an example.
Allow transforming data in the output stream.
def transform(io)
  flushbits
  saved = @io
  @io = io.prepend_to_chain(@io)
  yield(self, io)
  io.after_write_transform
ensure
  @io = saved
end