class BinData::IO::Write

def with_buffer(n)

bytes.
are written inside the block, the remainder will be padded with '\0'
+block+ will be contained within this buffer. If less than +n+ bytes
Sets a buffer of +n+ bytes on the io stream. Any writes inside the
def with_buffer(n)
  with_buffer_common(n) do |_buf_start, buf_end|
    yield
    write("\0" * (buf_end - offset))
  end
end