質問

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