Hi,
I serialize my thrift object, I write a file with serialization.
serializer = Thrift::Serializer.new()
binary_string=serializer.serialize(ticket)
bin = File.open("ticket.bin", "w+")
bin.write(binary_string)
bin.close
I open my file and I read and I try to serialize :
binaryticket = File.open("ticket.bin", "r:UTF-8")
contents = File.read(binaryticket)
ticket_deserialise = Ticket.new
deserializer = Thrift::Deserializer.new()
ticket_deserialise = deserializer.deserialize(ticket_deserialise,
contents)
But I have a error :
binary_protocol.rb:185:in `read_into_buffer': Not enough bytes remain in
memory buffer (EOFError)
I don't understand...
If I try to deserialize with the "binary_string",(without file) => no
problem !
ticket_deserialise = deserializer.deserialize(ticket_deserialise,
binary_string)
Ruby doesn't arrive to read file and to deserialize..
Thank you.