Daniel Martin <martind / martinhouse.internal> writes:

> Then:
>
> File.open("imap.mrk") {|f|
>   head_string = f.read(MRKHeader.round_byte_length)
>   raise "No header!" unless head_string
>   mrk_header = MRKHeader.new(head_string)
>   puts mrk_header.inspect
>   while msg_string = f.read(MRKMessage.round_byte_length) do
>     puts MRKMessage.new(msg_string)
>   end
> }

I forgot to open the file in binary mode, and forgot an inspect call.
I should have said:

File.open("imap.mrk", "rb") {|f|
  head_string = f.read(MRKHeader.round_byte_length)
  raise "No header!" unless head_string
  mrk_header = MRKHeader.new(head_string)
  puts mrk_header.inspect
  while msg_string = f.read(MRKMessage.round_byte_length) do
    puts MRKMessage.new(msg_string).inspect
  end
}