Class: BinData::Rest

Inherits:
BasePrimitive
  • Object
show all
Defined in:
lib/bindata/rest.rb

Overview

Rest will consume the input stream from the current position to the end of the stream. This will mainly be useful for debugging and developing.

require 'bindata'

class A < BinData::Record
string :a, read_length: 5
rest   :rest
end

obj = A.read("abcdefghij")
obj.a #=> "abcde"
obj.rest #=" "fghij"