class BitGirder::Io::BinaryWriter

Public Instance Methods

write( buf )
Alias for: write_full
write_bool( b ) click to toggle source
# File lib/bitgirder/io.rb, line 798
def write_bool( b )
    write_int8( b ? 1 : 0 )
end
write_buffer32( buf ) click to toggle source
# File lib/bitgirder/io.rb, line 818
def write_buffer32( buf )

    not_nil( buf, :buf )
    impl_write_buffer32( buf, buf.bytesize )
end
write_full( buf ) click to toggle source
# File lib/bitgirder/io.rb, line 803
def write_full( buf )
    @io.write( buf )
    @pos += buf.bytesize
end
Also aliased as: write
write_utf8( str ) click to toggle source
# File lib/bitgirder/io.rb, line 825
def write_utf8( str )

    not_nil( str, :str )
    
    RubyVersions.when_19x { str = Io.as_encoded( str, Encoding::UTF_8 ) }

    impl_write_buffer32( str, str.bytesize )
end

Private Instance Methods

impl_write_buffer32( buf, sz ) click to toggle source
# File lib/bitgirder/io.rb, line 811
def impl_write_buffer32( buf, sz )
    
    write_int32( sz )
    write_full( buf )
end