112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
# File 'lib/surpass/biff_record.rb', line 112
def to_biff
if @record_data.length > BIFF_LIMIT
chunks = []
pos = 0
while pos < @record_data.length
chunk_pos = pos + BIFF_LIMIT
chunk = @record_data[pos...chunk_pos]
chunks << chunk
pos = chunk_pos
end
continues = [self.class::RECORD_ID, chunks[0].length].pack('v2') + chunks[0]
chunks.each_with_index do |c, i|
next if i == 0
continues += [CONTINUE_RECORD_ID, c.length].pack('v2') + c
end
continues
else
+ @record_data
end
end
|