Method: BinData::IO::Write#transform

Defined in:
lib/bindata/io.rb

#transform(io) ⇒ Object

Allow transforming data in the output stream. See BinData::Buffer as an example.

io must be an instance of Transform.

yields self and io to the given block



207
208
209
210
211
212
213
214
215
216
# File 'lib/bindata/io.rb', line 207

def transform(io)
  flushbits

  saved = @io
  @io = io.prepend_to_chain(@io)
  yield(self, io)
  io.after_write_transform
ensure
  @io = saved
end