class Avro::IO::SingleObjectMessage
Constants
- SINGLE_OBJECT_MAGIC_NUMBER
Public Class Methods
new(schema)
click to toggle source
# File lib/ext/avro_patches.rb, line 41 def initialize(schema) @schema = schema end
Public Instance Methods
header()
click to toggle source
# File lib/ext/avro_patches.rb, line 46 def header [SINGLE_OBJECT_MAGIC_NUMBER, schema_fingerprint].flatten end
schema_fingerprint()
click to toggle source
# File lib/ext/avro_patches.rb, line 49 def schema_fingerprint working = @schema.crc_64_avro_fingerprint bytes = Array.new(8) 8.times do |i| bytes[7 - i] = (working & 0xff) working = working >> 8 end bytes end