The code below doesn't work, yet the type boolean exists and I used it in another class the same way, why doesn't it work here?

require 'bindata'
class TESTSTUFF < BinData::Record
  array  :boolstuff, :type => :boolean, :initial_length => 8
end

The error is: unknown type 'boolean' in TESTSTUFF (TypeError)

有帮助吗?

解决方案

There is no such parameter as boolean in bindata. Use bit1 that's a 1-bit big endian integer and may be used as boolean. Look at the docs.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top