Method: CcipherFactory::BinStruct#struct_from_bin

Defined in:
lib/ccipher_factory/encoding/bin_struct.rb

#struct_from_bin(bin) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/ccipher_factory/encoding/bin_struct.rb', line 13

def struct_from_bin(bin)
  bs = Binenc::EngineFactory.instance(:bin_struct)
  type, ver = bs.value_from_bin_struct(bin, 0, 1)
  c = BTag.value_constant(type) 
  st = struct(c, translate_version(ver))
  st.from_bin(bin) if not st.nil?
end