Method: BinData::Base#write

Defined in:
lib/bindata/base.rb

#write(io, &block) ⇒ Object

Writes the value for this data object to io.



155
156
157
158
159
160
161
162
163
164
# File 'lib/bindata/base.rb', line 155

def write(io, &block)
  io = BinData::IO::Write.new(io) unless BinData::IO::Write === io

  do_write(io)
  io.flush

  block.call(self) if block_given?

  self
end