Class: CSstats::Parser::Writer::FileStreamer
- Inherits:
-
Object
- Object
- CSstats::Parser::Writer::FileStreamer
- Defined in:
- lib/csstats/parser/writer/file_streamer.rb
Instance Attribute Summary collapse
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
Instance Method Summary collapse
-
#initialize(stream) ⇒ FileStreamer
constructor
A new instance of FileStreamer.
- #write_int_data(int) ⇒ Object
- #write_short_data(int) ⇒ Object
- #write_string_data(string) ⇒ Object
Constructor Details
#initialize(stream) ⇒ FileStreamer
7 8 9 |
# File 'lib/csstats/parser/writer/file_streamer.rb', line 7 def initialize(stream) @stream = stream end |
Instance Attribute Details
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
5 6 7 |
# File 'lib/csstats/parser/writer/file_streamer.rb', line 5 def stream @stream end |
Instance Method Details
#write_int_data(int) ⇒ Object
11 12 13 14 |
# File 'lib/csstats/parser/writer/file_streamer.rb', line 11 def write_int_data(int) data = [int].pack('V') stream.write(data) end |
#write_short_data(int) ⇒ Object
16 17 18 19 |
# File 'lib/csstats/parser/writer/file_streamer.rb', line 16 def write_short_data(int) data = [int].pack('v') stream.write(data) end |
#write_string_data(string) ⇒ Object
21 22 23 |
# File 'lib/csstats/parser/writer/file_streamer.rb', line 21 def write_string_data(string) stream.write(string) end |