# File lib/protocols/line_and_text.rb, line 92
 92:       def set_binary_mode size = nil
 93:         if @lbp_mode == :lines
 94:           if size == 0
 95:             receive_binary_data("") if respond_to?(:receive_binary_data)
 96:             # Do no more work here. Stay in line mode and keep consuming data.
 97:           else
 98:             @lbp_binary_limit = size.to_i # (nil will be stored as zero)
 99:             if @lbp_binary_limit > 0
100:               raise "Overlength" if @lbp_binary_limit > MaxBinaryLength # arbitrary sanity check
101:               @lbp_binary_buffer = "\0" * @lbp_binary_limit
102:               @lbp_binary_bytes_received = 0
103:             end
104: 
105:             @lbp_mode = :binary
106:             receive_data @lpb_buffer.flush
107:           end
108:         else
109:           raise "invalid operation"
110:         end
111:       end