Class: BitGirder::Io::BinaryWriter

Inherits:
BinaryIo
  • Object
show all
Defined in:
lib/bitgirder/io.rb

Instance Attribute Summary

Attributes inherited from BinaryIo

#conv, #pos

Instance Method Summary collapse

Methods inherited from BinaryIo

#close

Instance Method Details

#write_bool(b) ⇒ Object



798
799
800
# File 'lib/bitgirder/io.rb', line 798

def write_bool( b )
    write_int8( b ? 1 : 0 )
end

#write_buffer32(buf) ⇒ Object



818
819
820
821
822
# 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) ⇒ Object Also known as: write



803
804
805
806
# File 'lib/bitgirder/io.rb', line 803

def write_full( buf )
    @io.write( buf )
    @pos += buf.bytesize
end

#write_utf8(str) ⇒ Object



825
826
827
828
829
830
831
832
# 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