Class: BitGirder::Io::BinaryWriter
- Defined in:
- lib/bitgirder/io.rb
Instance Attribute Summary
Attributes inherited from BinaryIo
Instance Method Summary collapse
- #write_bool(b) ⇒ Object
- #write_buffer32(buf) ⇒ Object
- #write_full(buf) ⇒ Object (also: #write)
- #write_utf8(str) ⇒ Object
Methods inherited from BinaryIo
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 |