Skip to content

Instantly share code, notes, and snippets.

@Jesus
Created July 25, 2015 10:23
class MyInt16 < BinData::Record
def zero
0
end
uint8 :e, :check_value => lambda { value == 0 or value == 1 }
choice :int, :selection => :e do
int16be zero
int16le 1
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment