class Mingle::Io::Encoder

Public Instance Methods

write_headers( hdrs ) click to toggle source
# File lib/mingle/io.rb, line 71
def write_headers( hdrs )

    write_int32( HEADERS_VERSION1 )
    hdrs.fields.each_pair do |k, v|
        write_int32( TYPE_CODE_HEADERS_FIELD )
        write_utf8( k.external_form )
        write_utf8( v.to_s )
    end
    write_int32( TYPE_CODE_HEADERS_END )
end
write_int32( i ) click to toggle source
# File lib/mingle/io.rb, line 56
def write_int32( i )
    @bin.write_int32( i )
end
write_int64( i ) click to toggle source
# File lib/mingle/io.rb, line 61
def write_int64( i )
    @bin.write_int64( i )
end
write_utf8( s ) click to toggle source
# File lib/mingle/io.rb, line 66
def write_utf8( s )
    @bin.write_utf8( s )
end

Private Instance Methods

impl_initialize() click to toggle source
# File lib/mingle/io.rb, line 51
def impl_initialize
    @bin = BitGirder::Io::BinaryWriter.new( :order => BYTE_ORDER, :io => @writer )
end