Class: Avro::IPC::FramedWriter
- Inherits:
-
Object
- Object
- Avro::IPC::FramedWriter
- Defined in:
- lib/avro/ipc.rb
Instance Attribute Summary collapse
-
#writer ⇒ Object
readonly
Returns the value of attribute writer.
Instance Method Summary collapse
-
#initialize(writer) ⇒ FramedWriter
constructor
A new instance of FramedWriter.
- #to_s ⇒ Object
- #write_framed_message(message) ⇒ Object
Constructor Details
#initialize(writer) ⇒ FramedWriter
Returns a new instance of FramedWriter.
470 471 472 |
# File 'lib/avro/ipc.rb', line 470 def initialize(writer) @writer = writer end |
Instance Attribute Details
#writer ⇒ Object (readonly)
Returns the value of attribute writer.
469 470 471 |
# File 'lib/avro/ipc.rb', line 469 def writer @writer end |
Instance Method Details
#to_s ⇒ Object
489 |
# File 'lib/avro/ipc.rb', line 489 def to_s; writer.string; end |
#write_framed_message(message) ⇒ Object
474 475 476 477 478 479 480 481 482 483 484 485 486 487 |
# File 'lib/avro/ipc.rb', line 474 def () = .bytesize total_bytes_sent = 0 while - total_bytes_sent > 0 if - total_bytes_sent > BUFFER_SIZE buffer_size = BUFFER_SIZE else buffer_size = - total_bytes_sent end write_buffer([total_bytes_sent, buffer_size]) total_bytes_sent += buffer_size end write_buffer_size(0) end |