spider-gazelle / bindata

BinData - Parsing Binary Data in Crystal Lang
MIT License
48 stars 5 forks source link

Add support for `remaining_bytes` field #2

Closed mattrberry closed 4 years ago

mattrberry commented 4 years ago

Adds the ability to optionally read the remaining bytes out of io. If remaining_bytes is specified, it the rest of the io will be read into a Bytes array at the given name.

class Demo < BinData
  endian big

  uint8 :first
  remaining_bytes :rest
end
mattrberry commented 4 years ago

Should be all set now!