Method: Codec::Ebcdic#encode

Defined in:
lib/codec/fix.rb

#encode(buf, f) ⇒ Object



110
111
112
113
114
115
116
117
118
# File 'lib/codec/fix.rb', line 110

def encode(buf, f)
  out = f.get_value
  if @length >  0
    raise TooLongDataException if out.length > @length
    out = out.ljust(@length," ")
  end
  buf << EightBitsEncoding::UTF8_2_EBCDIC(out)
  return out.length      
end