lib/timber/log_file.rb
# Reads at most _bytes_ from current object
Reads at most _bytes_ from current object
Reads at most _bytes_ from current object
def read_from_current_object(bytes)
      bytes_left = current_object.size - @current_object_offset
      if bytes_left > bytes
        data = current_object.value.slice(@current_object_offset, bytes)
        @current_object_offset += bytes
      elsif bytes_left <= bytes
        data = current_object.value.slice(@current_object_offset, bytes_left)
        @current_object_idx   += 1
        @current_object_offset = 0
      end
      return data
    end
def read_from_current_object ( bytes ) bytes_left = current_object . size - @current_object_offset if bytes_left > bytes data = current_object . value . slice ( @current_object_offset , bytes ) @current_object_offset += bytes elsif bytes_left <= bytes data = current_object . value . slice ( @current_object_offset , bytes_left ) @current_object_idx += 1 @current_object_offset = 0 end return data end
Reads at most _bytes_ from current object
Reads at most _bytes_ from current object
bytes