+ # Read a null terminated string
+ #
+ # To be used with `Writer::write_string`.
+ #
+ # Returns a truncated string when an error is pending (`last_error != null`).
+ fun read_string: String
+ do
+ var buf = new FlatBuffer
+ loop
+ var byte = read_byte
+ if byte == null or byte == 0x00 then return buf.to_s
+ buf.chars.add byte.ascii
+ end
+ end
+
+ # Read the length as a 64 bits integer, then the content of the block
+ #
+ # To be used with `Writer::write_block`.
+ #
+ # Returns a truncated string when an error is pending (`last_error != null`).
+ fun read_block: String
+ do
+ var length = read_int64
+ if length == 0 then return ""
+ return read(length)
+ end
+